Pagini recente » Cod sursa (job #2354304) | Cod sursa (job #565006) | Cod sursa (job #2861994) | Cod sursa (job #3181060) | Cod sursa (job #264657)
Cod sursa(job #264657)
#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;
}