Cod sursa(job #915958)
Utilizator | Data | 15 martie 2013 16:59:41 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int x=1,p,c,nr=0;
int main()
{
f>>p;
while (nr<p)
{
x=x*5;
nr=2*nr+x/5;
}
g<<nr;
f.close();
g.close();
return 0;
}