Pagini recente » Cod sursa (job #3138485) | Cod sursa (job #162244) | Cod sursa (job #98720) | Cod sursa (job #1362199) | Cod sursa (job #46403)
Cod sursa(job #46403)
#include<fstream.h>
unsigned long long int n,d,m,b=1;
unsigned long long int diviz (long long int a,long long 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;
}