Cod sursa(job #268155)
Utilizator | Data | 28 februarie 2009 21:15:13 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include<stdio.h>
#define IN "next.in","r",stdin
#define OUT "next.out","w",stdout
int n,d;
void citire()
{
freopen(IN);
scanf("%d%d",&n,&d);
}
void solve()
{
int r=n%d;
freopen(OUT);
printf("%d",(d-r)%d+n);
}
int main()
{
citire();
solve();
return 0;
}