Cod sursa(job #247664)
Utilizator | Data | 23 ianuarie 2009 17:58:58 | |
---|---|---|---|
Problema | Factorial | Scor | 55 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream.h>
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
unsigned long int i=0,x=0,f,p;
fin>>p;
while(x<p)
{
i++;
f=i*5;
while(f%5==0)
{
x++;
f=f/5;
}
}
if(x==p)
fout<<" "<<i*5;
else
fout<<"-1";
return 0;
}