Cod sursa(job #8770)
Utilizator | Data | 25 ianuarie 2007 15:56:18 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <fstream.h>
#include <math.h>
int nr,x,y;
ifstream f;ofstream g;
int main()
{f.open("fact.in");g.open("fact.out");
while(!f.eof())
{f>>nr;x=1;y=0;
while(nr<=pow(5,x))
{y+=floor(nr/pow(5,x));
x++;}
g<<y<<endl;
}
f.close();g.close();
return 0;
}