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