Cod sursa(job #601217)
Utilizator | Data | 5 iulie 2011 14:02:33 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <stdio.h>
int main()
{
int p, n, coef;
FILE *fin = freopen("fact.in", "r", stdin);
FILE *fout = freopen("fact.out", "w", stdout);
scanf("%d", &p);
coef = (p-1);
n = p * 5;
while(coef)
{
coef /= 5;
n -= 5 * coef;
}
printf("%d\n", n);
}