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