Cod sursa(job #274042)
Utilizator | Data | 9 martie 2009 12:52:49 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <fstream>
using namespace std;
int main()
{
long long n=0,p,i;
ifstream in ("fact.in");
ofstream out("fact.out");
in>>p;
i=5;
while (n<p)
{
n+=i/5;
i+=5;
}
if (p)
out<<i-5;
else out<<1;
return 0;
}