很水的一道题,因为你发现这个函数是单调递减的,所以二分法求出函数的根即可。

 #include <cstdio>
#include <cmath>
//using namespace std; const double e = 1e-;
double p, q, r, s, t, u; inline double f(double x)
{ return p*exp(-x) + q*sin(x) + r*cos(x) + s*tan(x) + t*x*x + u; } int main()
{
//freopen("in.txt", "r", stdin); while(scanf("%lf%lf%lf%lf%lf%lf", &p, &q, &r, &s, &t, &u) == )
{
if(f()<-e || f()>e) { puts("No solution"); continue; }
double L = , R = , m;
for(int i = ; i < ; i++)
{
m = (L+R)/;
if(f(m) < ) R = m;
else L = m;
}
printf("%.4f\n", m);
} return ;
}

代码君

最新文章

  1. 多彩的Console打印新玩法
  2. 微信video标签全屏无法退出bug 本文系转载
  3. wkwebview a target=&quot;_blank&quot; 打不开链接的解决方案
  4. python添加tab键提示
  5. Objective-C:Foundation框架-常用类-NSMutableString
  6. EF初始化mysql数据库codefirst
  7. MFC 点击改变文本 加法计时器 伸缩窗体
  8. AngularJS创建新指令 - 基本功能
  9. [图形学] Chp10 OpenGL三维观察程序示例
  10. C++各种指针辨析
  11. 流量控制闸门——LimitLatch套接字连接数限制器
  12. Docke--Dockerfile指令介绍
  13. 树状数组BIT
  14. Unity中对系统类进行扩展的方法
  15. Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user&#39;s experience. For more jquery-1.12.4.js:10208
  16. Entity Frame Code First 简易教程
  17. Tensorflow学习笔记(2):tf.nn.dropout 与 tf.layers.dropout
  18. 进程间通信-Queue
  19. 【Alpha】阶段第九次Scrum Meeting
  20. Codeforces Round #555 (Div. 3) D. N Problems During K Days 【数学思维】

热门文章

  1. 所有的代码生成器都是浮云,如果可以用aspx文件作为模板
  2. Source Insight中文操作支持的宏
  3. Problem 1016 咒文卷轴 优先队列+前缀和+rmq
  4. 【转】并查集&amp;MST题集
  5. ios开发小技巧之摇一摇截屏
  6. Appium环境配置
  7. How do you design object oriented projects?
  8. hdu 4578 Transformation 线段树
  9. asp.net-(含:模拟登陆,照片列表)
  10. Spring 注入static变量