Cod sursa(job #21434)
Utilizator | Data | 23 februarie 2007 15:14:44 | |
---|---|---|---|
Problema | Factorial | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include<fstream.h>
int p;
main() {
int n,k=0,m;
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;
}