Cod sursa(job #38524)

Utilizator MirceampMuresan Mircea Paul Mirceamp Data 25 martie 2007 21:17:09
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<fstream>

using namespace std;

unsigned long int n,d;

void read();
void next();

int main()
{
read();
next();
return 0;

}
    
void read()
{
    ifstream fin("next.in");
    fin>>n>>d;   
    fin.close();
}
void next()
{
     ofstream fout("next.out");
     if(n%d == 0)
     fout<<n;     
     while(n%d != 0)
         n+=1;
     fout<<n;
     fout.close();
}