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