Cod sursa(job #58736)
Utilizator | Data | 7 mai 2007 09:16:45 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *f;
f=fopen("next.in","r");
int n,d;
fscanf(f,"%d %d",&n,&d);
fclose(f);
FILE *g;
g=fopen("next.out","w");
int numar;
n%d==0?numar=n:numar=(n/d)*d+d;
fprintf(g,"%d",numar);
fclose(g);
return 0;
}