博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 2199 Can you solve this equation?
阅读量:4613 次
发布时间:2019-06-09

本文共 847 字,大约阅读时间需要 2 分钟。

#include
#include
double f(double x){ return 8*x*x*x*x+7*x*x*x+2*x*x+3*x+6;}int main(void){ int t; double y,x1,x2,x3,y1,y2,y3; scanf("%d",&t); while(t--) { scanf("%lf",&y); x1=0; x2=100; y1=f(x1)-y; y2=f(x2)-y; if(y1>0||y2<0) { printf("No solution!\n"); } else { while(fabs(y1-y2)>=0.0001) { x3=(x1+x2)/2; y3=f(x3)-y; if(y3>=0) { x2=x3; } else { x1=x3; } y1=f(x1)-y; y2=f(x2)-y; } printf("%0.4f\n",x3); } } return 0;}

  

转载于:https://www.cnblogs.com/A--Q/p/5718747.html

你可能感兴趣的文章
c#遍历Dictionary使用KeyValuePair
查看>>
defineProperties属性的运用==数据绑定
查看>>
关于 IOS 发布的点点滴滴记录(一)
查看>>
《EMCAScript6入门》读书笔记——14.Promise对象
查看>>
CSS——水平/垂直居中
查看>>
Eclipse连接mysql数据库jdbc下载(图文)
查看>>
Python中Selenium的使用方法
查看>>
三月23日测试Fiddler
查看>>
20171013_数据库新环境后期操作
查看>>
poj 1654 && poj 1675
查看>>
运维派 企业面试题1 监控MySQL主从同步是否异常
查看>>
Docker 版本
查看>>
poj 1753 Flip Game
查看>>
在深信服实习是怎样的体验(研发测试岗)
查看>>
Linux免密码登陆
查看>>
SpringMVC中文件的上传(上传到服务器)和下载问题(二)--------下载
查看>>
Socket & TCP &HTTP
查看>>
osip及eXosip的编译方法
查看>>
Hibernate composite key
查看>>
[CF Round #294 div2] D. A and B and Interesting Substrings 【Map】
查看>>