Cod sursa(job #287772)
Utilizator | Data | 25 martie 2009 09:36:03 | |
---|---|---|---|
Problema | Factorial | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
int p,n=0,e;
ifstream fin("fact.in");
fin>>p;
fin.close();
ofstream fout("fact.out");
if(p==0)n=1;
while(p)
{
n+=5;e=n;
while(e%5==0)e/=5,p--;
}
fout<<n;
fout.close();
return 0;
}