Cod sursa(job #263039)
Utilizator | Data | 19 februarie 2009 21:09:02 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include<fstream>
using namespace std;
int main()
{
long p,i=1,x=1;
ifstream in("fact.in");
ofstream out("fact.out");
in>>p;
if (p!=0) {while (p!=0)
{i=x;
while (i%5==0)
{p--;
i=i/5;}
x++;}
x--;}
else x=-1;
out<<x;
in.close();
out.close();
return 0;
}