Cod sursa(job #263905)
Utilizator | Data | 20 februarie 2009 22:22:52 | |
---|---|---|---|
Problema | Factorial | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 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/6!=0)
{x=x+25;
i=x;
p=p-4;
while (i%5==0)
{p--;
i=i/5;}}
if (p>=0) x=x+p*5;
out<<x;
in.close();
out.close();
return 0;
}