Cod sursa(job #1141491)

Utilizator otto1Palaga Vicentiu-Octavian otto1 Data 12 martie 2014 21:59:48
Problema Factorial Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
#include<fstream>
using namespace std;
unsigned long int P,N,aux,z;
int main()
{ifstream f("fact.in");
ofstream g("fact.out");
f>>P;
if(P==0)
g<<1;
else
{while(z<P)
{N+=5;
aux=N;
while(aux%5==0)
{z++;
aux/=5;
}
}
if(z>P)
g<<-1;
else
g<<N;
}
return 0;
}