Cod sursa(job #185563)
Utilizator | Data | 25 aprilie 2008 17:42:41 | |
---|---|---|---|
Problema | Factorial | Scor | 55 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 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++;
}
}
if(p==k)
fout<<s;
else
fout<<"-1";
return 0;
}