Cod sursa(job #58679)
Utilizator | Data | 6 mai 2007 19:55:54 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <stdio.h>
int main(void)
{
FILE *f;
f=fopen("next.in","r");
int n; int d;
fscanf(f,"%d %d",&n, &d);
fclose(f);
f=fopen("next.out","w");
int numar;
if(n%d==0)
{
numar=n;
}
else
{
// numar=
}
n%d==0?numar=n:numar=(n/d)*d+d;
fprintf(f,"%d",numar);
fclose(f);
return 0;
}