Cod sursa(job #1568365)

Utilizator iDanyelArvat Ovidiu Daniel iDanyel Data 14 ianuarie 2016 10:15:09
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    ifstream f("next.in");
    ofstream g("next.out");
    int n, d, m = 1, gasit = 0, t;
    f >> n >> d;
    while(gasit==0)
    {
        if((m>=n)&&(m%d==0))
        {
            gasit = 1;
            t=m;
        }
        m++;
    }
    m=t;
    g << m;
    f.close();
    g.close();
    return 0;
}