Pagini recente » Cod sursa (job #141044) | Cod sursa (job #1189580) | Cod sursa (job #1536851) | Cod sursa (job #143831) | Cod sursa (job #473757)
Cod sursa(job #473757)
#include <fstream>
#include <iostream>
#include <stdio.h>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
long p;
int t = 0;
f >> p;
unsigned int i,y = 0,z;
for (i = 1 ; i < 64000 ; i++ )
{
z = i;
while ( z % 5 == 0 )
{
y++;
z = z / 5;
}
if ((x > y) && (y == p ))
{
g << i ;
break;
t = 1;
}
if (y > p)
{
break;
}
}
if (t==0) {
g << "-1";
}
return 0;
}