Cod sursa(job #46385)
Utilizator | Data | 2 aprilie 2007 16:49:34 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream.h>
unsigned long long int n,d,m,b=1;
unsigned long int div (int a,int b)
{
int c=0;
if (a%b==0) c=1;
return c;
}
int main ()
{
ifstream citeste ("next.in");
ofstream scrie ("next.out");
citeste>>n>>d;
m=n;
if (div(m,d)==1) scrie<<m;
else
{
b=1;
while (b==1)
{
m++;
if (div(m,d)==1) b=0;
}
}
scrie<<m;
return 0;
}