Cod sursa(job #38509)
Utilizator | Data | 25 martie 2007 21:04:52 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream>
using namespace std;
int n;
int d;
ofstream fout("next.out");
void read();
void next();
int main()
{
read();
next();
fout.close();
return 0;
}
void read()
{
ifstream fin("next.in");
fin>>n>>d;
fin.close();
}
void next()
{
if(n%d == 0)
fout<<n;
if(n%d != 0)
while(n%d != 0)
n+=1;
fout<<n;
}