Cod sursa(job #1739467)

Utilizator mjmilan11Mujdar Milan mjmilan11 Data 9 august 2016 15:26:43
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("next.in");
ofstream fout("next.out");

int n,d;

int main()
{
    fin >> n >> d;
    if(n%d==0)
        fout << n;
    else
    {
        fout << n+d-n%d;
    }
    return 0;
}