D - Can you solve this equation?

Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;
Now please try your lucky.

InputThe 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 a real number Y (fabs(Y) <= 1e10);OutputFor each test case, you should just output one real number(accurate up to 4 decimal places),which is the solution of the equation,or “No solution!”,if there is no solution for the equation between 0 and 100.Sample Input

2
100
-4

Sample Output

1.6152
No solution!


 #include<iostream>
#include<cmath>
using namespace std; double f(double x){
return (*pow(x,) + *pow(x,) + *pow(x,) + *x + );
} int main()
{
int t;
double m,n;
scanf("%d",&t);
while(t--){
scanf("%lf",&m);
if(f()>m||f()<m){
printf("No solution!\n");
continue;
}
double left = , right = , mid;
while(fabs(f(mid)-m) > 1e-){
mid=(left + right)/;
if((f(mid) > m)) right = mid;
else if(f(mid)<m) left=mid;
}
printf("%.4lf\n",mid);
}
return ;
}

最新文章

  1. Python的垃圾回收机制
  2. ajax 和 post 传多个参数值具体怎么写
  3. comboBox的id返回System.Data.DataRowView
  4. meta是什么意思?
  5. Java SE/ME/EE的概念介绍
  6. android开发学习笔记:圆角的Button
  7. HDOJ(HDU) 1985 Conversions(汇率转换)
  8. 一封推荐信——android培训机构
  9. Openlayer 3 的点击弹出框
  10. 关于Lt分发系统的时序图分析
  11. 如何在SpriteBuilder中设置对象的通用属性
  12. Android初级教程以动画的形式弹出窗体
  13. 05python上
  14. 学习Junit资料
  15. CSS特效(弧光效果)
  16. Linux笔记 #07# 搭建机器学习环境
  17. Spark(十五)SparkCore的源码解读
  18. 共享内存简介和mmap 函数
  19. Spring AOP声明式事务异常回滚(转)
  20. WOL*LAN远程换醒命令行方法

热门文章

  1. Dijkstra算法2
  2. gradle与android studio 关系及gradle配置
  3. Html介绍,了解html代码的注释
  4. Linux centos7 安装 phpMyAdmin
  5. CF594D REQ [离线+树状数组,欧拉函数]
  6. filter逻辑bug
  7. mysql版本报错
  8. STL-优先级队列-priority_queue
  9. ECMAScript基本对象——Number 对象
  10. 剑指offer-面试题10-斐波那契数列-递归循环