Cod sursa(job #181031)
| Utilizator | Data | 17 aprilie 2008 20:11:18 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <stdio.h>
FILE* f;
FILE* s;
int main()
{
f=fopen ("fact.in","r");
s=fopen ("fact.out","w");
long int n;
fscanf (f,"%ld",&n);
long int f=5;
long int c=0;
while (f<=n)
{
c=c+(n/f);
f=f*5;
}
fprintf (s,"%ld",c);
fcloseall();
return 0;
}