Pagini recente » Monitorul de evaluare | Borderou de evaluare (job #512269) | Cod sursa (job #2913893) | Diferente pentru problema/puteri4 intre reviziile 4 si 5 | Cod sursa (job #46396)
Cod sursa(job #46396)
#include<fstream.h>
unsigned long long int n,d,m,b=1;
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;
}