Cod sursa(job #170405)
Utilizator | Data | 2 aprilie 2008 18:46:00 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream>
using namespace std;
fstream f,g;
int i,n,k,x;
int main()
{
f.open("fact.in",ios::in);
f>>k;
f.close();
n=0;
g.open("fact.out",ios::out);
if(k==0) g<<1;
else {
for(i=5;n<=k;i=i+5)
{
x=i;
while(x%5==0)
{
n++;
x=x/5;
}
x=i;
}
}
g<<x;
g.close();
return 0;
}