作业:二分法求方程的根

这篇笔记介绍了如何利用二分法和递归的方法求解一元高次方程,特别是在0到100范围内寻找F(x)=5x^7+6x^6+3x^3+4x^2-2xy的最小值,其中y为给定的实数。样例输入和输出展示了不同y值下函数的最小值。
摘要由CSDN通过智能技术生成

用二分法+递归解一元高次方程。此方法只能求出在规定范围内的一个根,并求出原函数在该解处的值。

附上原题:

题目描述
Joy is a twelfth grade student who is aiming to go to SUSTech. One day, when he is doing math practices. He found a problem very hard. It gives a function goes like F(x) = 5x7+6x6+3x3+4x2-2xy (0 <= x <=100), y is a given real number. Can you help Joy find the minimum value of F(x) when x is in its domain?

输入
The first line of the input contains an integer T (1 <= T <= 100) which means the number of test cases. Then T lines follow, each line has only one real numbers Y (0 < Y < 1010).

输出
For each case, print the case number as well as the minimum value (accurate up to 4 decimal places) in one line, when x is in its domain.
样例输入
3
100
200
300
样例输出
Case 1: -193.3774
Case 2: -448.1475
Case 3: -729.3383


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值