Cod sursa(job #829206)
Utilizator | Data | 4 decembrie 2012 22:12:22 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main ()
{
int x=0,p,k=0,n=0;
fin >> p;
if(p==0)fout<<"1";
while(k<p)
{
n=x;
while(n%5==0)
{
n=n/5;
k++;
}
x+=5;
}
fout<<x;
fin.close();
fout.close();
return 0;
}