#include <stdio.h>
#include <math.h>
int func(double x)
{
return 8*x*x*x*x+7*x*x*x+2*x*x+3*x+6;
}
int main()
{
int n;
double left,right,mid,Y;
scanf("%d",&n);
while(n--)
{
scanf("%lf",&Y);
if(Y>func(100)||Y<func(0))
printf("No solution!\n");
else
{
right=100.0;
left=0.0;
while((right-left)>1e-8)
{
mid=(left+right)/2.0;
if(func(mid)<Y)
left=mid;
else
right=mid;
}
printf("%.4lf\n",left);
}
}
return 0;
}hdu2199 Can you solve this equation? (二分搜索)
最新推荐文章于 2021-02-10 11:42:51 发布
本文深入探讨了四元数插值算法在动画制作中的关键作用,通过详细解析其原理与实践应用,展示了如何利用四元数实现平滑、自然的旋转动画效果。同时,文章还对比了不同插值方法的优劣,为动画师提供了一套高效、灵活的解决方案。
639

被折叠的 条评论
为什么被折叠?



