Cod sursa(job #46401)
Utilizator | Costica Vlad dj_vladootz | Data | 2 aprilie 2007 16:54:35 |
---|---|---|---|
Problema | Next | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<fstream.h>
unsigned long long int n,d,m,b=1;
unsigned long long int diviz (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 (diviz (m,d)==1) scrie<<m;
else
{
b=1;
while (b==1)
{
m++;
if (diviz (m,d)==1) b=0;
}
}
scrie<<m;
return 0;
}