Pagini recente » Cod sursa (job #1946961) | Cod sursa (job #1587312) | Cod sursa (job #1311366) | Cod sursa (job #1846988) | Cod sursa (job #1326985)
#include <fstream>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int v[200];
int main()
{
long long p , n , fact , i , aux , cnt , k , j ;
fin >> p ;
cnt=0;k=0;
for (n=1;n<=1000000;n++)
{
fact=1;cnt=0;
for (i=1;i<=n;i++)
{
fact*=i;
}
aux=fact;
while (aux%10==0)
{
cnt++;
aux/=10;
}
if (cnt==p) {fout << n ; n=1000001;}
}
return 0;
}