Cod sursa(job #630903)
Utilizator | Data | 6 noiembrie 2011 18:39:16 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<fstream>
using namespace std;
int main()
{
ifstream f("fact.in");
ofstream g("fact.out");
long x,i,cont,aux;
f>>x;
if(x==0)
g<<1;
else
{
cont=0;
i=5;
while(cont<x)
{
aux=i;
while(aux%5==0)
cont++,aux=aux/5;
i+=5;
}
i-=5;
g<<i;
}
return 0;
}