Cod sursa(job #880521)

Utilizator otto1Palaga Vicentiu-Octavian otto1 Data 16 februarie 2013 21:08:30
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include<fstream>
using namespace std;
unsigned long int P,N,aux,z;
int main()
{ifstream f("factorial.in");
ofstream g("factorial.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;
}