Cod sursa(job #253223)
Utilizator | Data | 5 februarie 2009 16:10:03 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<stdio.h>
long p,n,x,f5;
int main()
{
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%ld",&p);
if(p!=0)
{
n=4;
do
{
n++;
x=n;
while(x%5==0)
{
f5++;
x/=5;
}
}
while(f5<p);
printf("%ld",n);
}
else printf("1");
return 0;
}