double n = 1,m;
Console.WriteLine("请输入您要开根号的数:");
m = Convert.ToDouble(Console.ReadLine());
for (int i = 0; 1==1; i++)
{
n = (n + m / n) /2;
if (i==10000)
{
break;
}
}
Console.WriteLine(n);
时间: 2024-10-01 10:59:39