> 数学 >
利用二分法设计一个算法求根号7的近似值(精确度为0.3)
人气:161 ℃ 时间:2020-04-16 14:40:19
解答
void main()
{ float l=2.5,h=3.0,m=(l+h)/2;
while(h-l=7) h=m;
else l=m;
m=(l+h)/2;
}
printf("根号7的近似值是:%f\n);
}
推荐
猜你喜欢
© 2025 79432.Com All Rights Reserved.
电脑版|手机版