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