#include <iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
#include<vector>
#define ENTER printf("\n");
#define MOD 1000000007
//快速打印一个数组
#define ll long long
#define NUM 1000
#define delta 1e-6
using namespace std;
//构造函数 析构函数怎么打印出地址
int t;
int y;
double fd(double mid)
{
return 42 * mid * mid * mid * mid * mid * mid + 48 * mid * mid * mid * mid * mid + 21 * mid * mid + 10 * mid - y;
}
double f(double x)
{
return 6 * x * x * x * x * x * x * x + 8 * x * x * x * x * x * x + 7 * x * x * x + 5 * x * x - y * x;
}
int main()
{
scanf("%d", &t);
while (t--)
{
scanf("%d", &y);
double left = 0;
double right = 100;
double mid = (left + right) / 2;
while (fabs(fd(mid))> delta)
{
if (fd(mid) > delta)
right = mid;
else
left = mid;
mid = (left + right) / 2;
}
printf("%.4lf\n", f(mid));
}
return 0;
}
07-23
414
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-29
463
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-05
336
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-21
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交