Cod sursa(job #430317)
Utilizator | Data | 30 martie 2010 21:53:16 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
using namespace std;
int main()
{
long n, aux, s, exp;
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>n;
int ok=0;
s=4*n;
while(ok==0)
{
aux=s;
exp=0;
while(aux)
{
exp+=aux/5;
aux=aux/5;
}
if(exp==n)
ok=1;
else
s+=5;
}
fout<<s;
return 0;
}