标签:
2 100 -4
1.6152 No solution!#include<stdio.h> double m; double f(double x) { return 8*x*x*x*x+7*x*x*x+2*x*x+3*x+6; } int main() { int n; scanf("%d",&n); while(n--) { double l,r,s,h; scanf("%lf",&m); if(f(0)<=m&&f(100)>=m) { l=0,r=100; while(r-l>1e-7) { h=(r+l)/2; s=f(h); if(s>m) r=h; else l=h; } printf("%.4lf\n",(r+l)/2); } else printf("No solution!\n"); } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/l15738519366/article/details/47150239