Cod sursa(job #1151454)

Utilizator ionut98Bejenariu Ionut Daniel ionut98 Data 24 martie 2014 10:02:22
Problema Next Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream>
using namespace std;
unsigned long long n,d,nr,ok;
int main()
{
    ifstream f("next.in");
    ofstream g("next.out");
    f>>n>>d;
    ok=0;
    nr=n;
    while(ok==0)
    {
        if(nr%d==0)
        ok=1;
        else
        nr++;
    }
    g<<nr;
    return 0;
}