Cod sursa(job #3370122)
| Utilizator | Data | 24 octombrie 2026 10:40:22 | |
|---|---|---|---|
| Problema | Next | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("next.in");
ofstream fout ("next.out");
int main()
{
int n,m,d;
fin>>n>>d;
m=n/d;
m=m*d+d;
if(m==n)
{
fout<<n-d;
}
else
{
fout<<m;
}
return 0;
}
