Cod sursa(job #8768)
Utilizator | Data | 25 ianuarie 2007 15:53:10 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 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");x=1
while(!feof())
{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();
}