Cod sursa(job #37715)
Utilizator | Data | 25 martie 2007 12:09:26 | |
---|---|---|---|
Problema | Next | Scor | 0 |
Compilator | cpp | Status | done |
Runda | preONI 2007, Runda 4, Clasa a 9-a si gimnaziu | Marime | 0.27 kb |
#include <fstream.h>
int main ()
{
ifstream f("next.in");
ofstream g("next.out");
long double n,d;
f>>n;
f>>d;
unsigned long int x,k;
x=n/d;
long float 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;
}