Pagini recente » Cod sursa (job #1523722) | Cod sursa (job #2893391) | Cod sursa (job #256112) | Cod sursa (job #1817769) | Cod sursa (job #473749)
Cod sursa(job #473749)
#include <fstream>
#include <iostream>
#include <stdio.h>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
int p,x = 0,y = 0,z;
f >> p;
for (int i = 1 ; i < 20 ; i++ )
{
z = i;
while ( z % 2 == 0 )
{
x++;
z = z / 2;
}
z = i;
while ( z % 5 == 0 )
{
y++;
z = z / 5;
}
if ((x < y) && (x == p ))
{
g << i ;
break;
}
if ((x > y) && (y == p ))
{
g << i ;
break;
}
}
return 0;
}