Cod sursa(job #397616)
Utilizator | Data | 17 februarie 2010 11:30:42 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include<stdio.h>
int main()
{
int p=5,pp=5,n,nfact=0;
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%d", &n);
while ( (n/pp)>=1)
{
nfact = nfact + n/p;
pp = p*pp;
}
printf("%d",nfact);
}