Cod sursa(job #572855)
Utilizator | Data | 5 aprilie 2011 18:07:58 | |
---|---|---|---|
Problema | Next | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.22 kb |
#include<iostream.h>
#include<fstream.h>
long long n,d,m,c;
int main()
{ifstream f("next.in");
ofstream h("next.out");
f>>n;
f>>d;
if(n%d==0)
h<<n;
else
{c=n/d;
m=c*d;
while(m<n)
m=m+d;}
h<<m;
return 0;}