Pagini recente » Cod sursa (job #1829757) | Cod sursa (job #726850) | Cod sursa (job #2653591) | Cod sursa (job #678481) | Cod sursa (job #261620)
Cod sursa(job #261620)
#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
long P;
int *a = new int[100];
int main()
{
freopen ("fact.in","r",stdin);
freopen ("fact.out","w",stdout);
scanf("%ld",&P);
long BigGuess = 1;
if (BigGuess == 0)
{
printf("%ld\n",1);
return 0;
}
else
{
long val = 1;
long counter = 0;
bool done = false;
long reached = 0;
long NoOf5 = 0;
while (NoOf5 < P)
{
reached += 5;
long aux = reached;
while (aux % 5 == 0)
{
aux = aux / 5;
NoOf5 += 1;
}
}
printf("%ld\n",reached);
}
return 0;
}