Cod sursa(job #139154)
| Utilizator | Data | 19 februarie 2008 19:33:04 | |
|---|---|---|---|
| Problema | Factorial | Scor | 25 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<stdio.h>
#include<fstream.h>
int main()
{
long p,n,tt,t,k5=0;
//ifstream in("fact.in");
//ofstream out("fact.out");
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%ld ",&p);
//in>>p;
//in.close();
t=0;
do {
t+=5;
tt=t;
while(!(tt%50))
{tt=tt/5;
k5++;}
}while(k5!=p);
//out<<t;}
//out.close();
if(p==0)
printf("1");
else
printf("%ld",t/10);
return 0;
}
