Cod sursa(job #37899)

Utilizator gabitzish1Gabriel Bitis gabitzish1 Data 25 martie 2007 13:01:55
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include<fstream.h>

long n, m, d;

void citire()
{
  ifstream in("next.in");
  in>>n;
  in>>d;
  in.close();
}


void prelucrare()
{
  long x, y;
  ofstream out("next.out");
  x=n/d;
  if (x*d==n) out<<n;
    else { y=(x+1)*d;
	   out<<y;
	 }


  out.close();
}

int main()
{
  citire();
  prelucrare();
  return 0;
}