Cod sursa(job #248811)
Utilizator | Data | 26 ianuarie 2009 21:08:15 | |
---|---|---|---|
Problema | Factorial | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <fstream.h>
int main()
{ int p,i,z,y,k=0;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;i=5;
if (p==0) g<<1;
else {
while (k<p) { y=i; i=i+5;z=i;
while (z%5==0) {k++; z=z/5;}
}
g<<y; }
f.close();
g.close();
return 0;
}