Cod sursa(job #139143)
| Utilizator | Data | 19 februarie 2008 19:26:50 | |
|---|---|---|---|
| Problema | Factorial | Scor | 50 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 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();
if(p==0)
//out<<"1";
printf("1");
else
{t=0;
do {
t+=5;
tt=t;
while(tt%5==0)
{tt=tt/5;
k5++;}
}while(k5!=p);
//out<<t;}
//out.close();
printf("%ld",t);
}
return 0;
}
