using System;
using static System.Console;
namespace ConsoleApp10
{
class Program
static void Main(string[] args)
double a=1,x=double.Parse(ReadLine());
for(int i=1;Math.Pow(2,i)<65;i++)
if (i > 1)
a *= ((x - Math.Pow(2, i) + 1) / (x - Math.Pow(2, i)));
else
a*=(x - 1) / (x - 2);
}
WriteLine(a);
ReadKey();
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
using System;
using static System.Console;
namespace ConsoleApp10
{
class Program
{
static void Main(string[] args)
{
double a=1,x=double.Parse(ReadLine());
for(int i=1;Math.Pow(2,i)<65;i++)
{
if (i > 1)
a *= ((x - Math.Pow(2, i) + 1) / (x - Math.Pow(2, i)));
else
a*=(x - 1) / (x - 2);
}
WriteLine(a);
ReadKey();
}
}
}