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