Pagini recente » Cod sursa (job #2788387) | Cod sursa (job #2655480) | Diferente pentru problema/harta intre reviziile 4 si 3 | Cod sursa (job #1759245) | Cod sursa (job #1612710)
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int n, x=0;
fin >> n;
if(n==0)
{
fout << "1";
return 0;
}
int i;
for(i=0; i<n;)
{
x+=5;
int aux=x;
while(aux%5==0 && aux!=0)
{
i++;
aux=aux/5;
}
}
if(i>n)
{
fout << "-1";
return 0;
}
fout << x;
return 0;
}