Cod sursa(job #21435)
| Utilizator | Data | 23 februarie 2007 15:20:27 | |
|---|---|---|---|
| Problema | Factorial | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.25 kb |
#include<fstream.h>
main() {
long n,k=0,m,p;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
if(p==1) g<<0;
else {
n=5;
while(k!=p) {
m=n;
while(m%5==0) {m/=5;k++;}
n+=5;
}
g<<n-5;
}
return 0;
}
