Can you solve this equation?
来源:互联网 发布:js点击弹出再点击隐藏 编辑:程序博客网 时间:2024/06/05 19:21
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.
Now please try your lucky.
2100-4
1.6152No solution!
#include<iostream>#include<cmath>#include<cstdio>using namespace std;double l,h,mid,y;double run(double x){ return 8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*x+6;}int main(){ int T; cin>>T; while(T--) { cin>>y; l=0;h=100; while(l+1e-8<h) { mid=(l+h)/2; if(run(mid)>y) h=mid; else l=mid; } if (l==0||h==100) cout<<"No solution!"<<endl; else printf("%.4lf\n",l); } return 0;}
阅读全文
0 0
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- Can you solve this equation?
- 数组指针和指针数组的区别
- Java并发编程:线程池的使用
- 【算法】对称二叉树的判断
- dropout是什么,理解dropout
- LitePal+RecyclerView+checkBox实现便签功能(仿小米便签)
- Can you solve this equation?
- 【HLS】M3U8格式讲解及实际应用分析
- CSDN-markdown语法之如何使用LaTeX语法编写数学公式
- docker示例--下载ubuntu镜像安装python
- SAP内存和ABAP内存的简单介绍说明
- 小白算法练习 hdu courses 1083 匈牙利算法 dfs 邻接矩阵 vector模拟邻接表
- POJ2243 Knight Moves —— A*算法
- 数学之美 贝叶斯 (转载:推荐)
- 【python 验证码】产生中文验证码