Pagini recente » Cod sursa (job #2264427) | Cod sursa (job #690598) | Cod sursa (job #1864235) | Cod sursa (job #2976261) | Cod sursa (job #1326986)
#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;
}