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