Cod sursa(job #38784)

Utilizator Mishu91Andrei Misarca Mishu91 Data 26 martie 2007 09:36:13
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
using namespace std;
#include<fstream>
int n,d,m;
int main()
{
  ifstream fin("next.in");
  ofstream fout("next.out");
  fin>>n>>d;
  int ok=0;
  int k=n-1;
  while(ok==0){k++; if(k%d==0) ok=1;}
  fout<<k<<"\n";
  fin.close();
  fout.close(); 
  return 0;
}