Cod sursa(job #185553)
| Utilizator | Data | 25 aprilie 2008 17:28:54 | |
|---|---|---|---|
| Problema | Factorial | Scor | 5 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream.h>
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
int s=0,p,k=0,aux;
fin>>p;
while(k<=p)
{
s+=5;
aux=s;
while(aux%5==0)
{
aux/=5;
k++;
}
}
fout<<k;
return 0;
} 