Cod sursa(job #38786)

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