Cod sursa(job #38101)

Utilizator cristina_ana_tdrToderoiu Cristina Ana cristina_ana_tdr Data 25 martie 2007 14:43:43
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <fstream.h>
int main()
{
unsigned long n, d=1, x;
int nu;
ifstream f("next.in");
ofstream g("next.out");
f>>n>>d;
nu=0;
x=n;
do
{if(x%d==0)
    {g<<x;
     nu=1;}
 else
     x++;
}
while(nu==0);
f.close();
g.close();
return 0;
}