Cod sursa(job #870323)
| Utilizator | Data | 3 februarie 2013 11:02:03 | |
|---|---|---|---|
| Problema | Factorial | Scor | 15 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <cstdio>
using namespace std;
long long p, n, i, x, ap;
int main()
{
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
scanf("%lld", &p);
n=0;
i=0;
while(n < p)
{
i+=5;
x=i;
ap = 0;
while(x%5==0)
{
x/=5;
ap++;
}
n+=ap;
}
printf("%d", i);
return 0;
}
