Cod sursa(job #1568376)
Utilizator | Data | 14 ianuarie 2016 10:21:22 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream f("next.in");
ofstream g("next.out");
int N, D, M = N, gasit = 0;
f >> N >> D;
while(gasit==0)
{
if((M>=N)&&(M%D==0)) gasit = 1;
if(gasit==0) M++;
}
g << M;
f.close();
g.close();
return 0;
}