Cod sursa(job #6315)
Utilizator | Data | 18 ianuarie 2007 20:20:51 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <stdio.h>
int main()
{
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
long p,n,i,aux;
scanf("%ld",&p);
i=0;
while (p>0)
{
i+=5;
aux=i;
while (aux%5==0) {
p--;
aux=aux/5;
}
}
printf("%ld", i);
return 0;
}