Cod sursa(job #1568372)

Utilizator iDanyelArvat Ovidiu Daniel iDanyel Data 14 ianuarie 2016 10:19:35
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 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, t;
    f >> N >> D;
    while(gasit==0)
    {
        if((M>=N)&&(M%D==0))
        {
            gasit = 1;
            t=M;
        }
        M++;
    }
    g << t;
    f.close();
    g.close();
    return 0;
}