Cod sursa(job #574101)
Utilizator | Data | 6 aprilie 2011 20:22:51 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include<fstream>
using namespace std;
int main()
{unsigned long long n, p, r, d;
ifstream f("fact.in");
ofstream h("fact.out");
f>>p;
if (p==0)
n=1;
else
{d=4*p+1;
n=5;
while (n<d)
n=n*5;
}
h<<n<<endl;
f.close();
h.close();
return 0;
}