Cod sursa(job #264651)
Utilizator | Data | 22 februarie 2009 15:35:42 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <stdio.h>
#include <stdlib.h>
#define deschidere(cale,mod,f)\
if((f=fopen(cale,mod))==NULL){\
printf("\nNu se poate deschide %s\n",cale);\
exit(1);\
}
int main(){
FILE *f;
long n,d,next;
deschidere("next.in","rt",f);
fscanf(f,"%ld %ld",&n,&d);
fclose(f);
next=n-n%d+d;
deschidere("next.out","wt",f);
fprintf(f,"%ld",next);
fclose(f);
return 0;
}