Cod sursa(job #38135)

Utilizator cristian_alex_81cristian alexandru cristian_alex_81 Data 25 martie 2007 15:01:21
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <fstream.h>

int main ()
{

ifstream f("next.in");
ofstream g("next.out");

long double n,d;

f>>n;
f>>d;

long int x,k;
x=n/d;
long double z,y;
z=n/d;
y=z-x;
k=d*y;
long double m;
m=n+(d-k)-1;
g<<m;

g.close ();
f.close ();
return 0;
}