Cod sursa(job #264653)
| Utilizator | Data | 22 februarie 2009 15:37:33 | |
|---|---|---|---|
| Problema | Next | Scor | 10 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 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 long n,d,next;
deschidere("next.in","rt",f);
fscanf(f,"%lld %lld",&n,&d);
fclose(f);
next=n-n%d+d;
deschidere("next.out","wt",f);
fprintf(f,"%lld",next);
fclose(f);
return 0;
}
