Pagini recente » Cod sursa (job #2558371) | Cod sursa (job #1201160) | Cod sursa (job #3125773) | Cod sursa (job #2347344) | Cod sursa (job #264653)
Cod sursa(job #264653)
#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;
}