Cod sursa(job #250442)
Utilizator | Data | 30 ianuarie 2009 22:35:28 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <stdio.h>
long p, t;
int main(void)
{
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
scanf("%ld", &p);
t=p-(p/5)-(p/25)-(p/125)-(p/625)-(p/3125)-(p/15625)-(p/78125)-(p/390625)-(p/1953125)-(p/9765625)-(p/48828125)-(p/244140625)-(p/1220703125);
printf("%ld", t*5);
fcloseall();
return 0;
}