This is, for the first time I saw such a fun thing...
I have never considered such a problem before ,,,
Incorrect precision processing. The question is coming soon. Well, this is really a test of people's patience. Well, next time, will the EPS be opened a little less?
As I have just proved, the first time I started it was 1e-8, obviously not enough, but less than 1e-13 .. hey hey. so be sure to pay attention to it in the future. Open it hard ....
Haha, because the smaller you open, the closer you get to the answer...
Have a long time and wisdom.
Paste the Code:
# Include <stdio. h> # include <string. h> # include <stdlib. h> # include <math. h> // the incremental function is obtained because the derivative of the function is 0-constant and 0; // the minimum value is 6 because it is an incremental function; none of the values smaller than 6; const double EPS = 1e-15; double F (Double X) {return 8 * POW (x, 4) + 7 * POW (x, 3) + 2 * POW (x, 2) + 3 * x + 6;} int main () {int t; scanf ("% d", & T ); while (t --) {Double Y; scanf ("% lf", & Y); If (Y <6 | Y> F (100.0) printf ("no solution! \ N "); else {double L = 0, r = 100, mid; while (L + EPS <= r) {mid = (L + r)/2; double P = f (MID); If (FABS (p-y) <= 1e-5) {printf ("%. 4lf \ n ", mid); break;} else if (P <Y) L = mid; elser = mid;} If (L + EPS> r) printf ("no solution! \ N ") ;}} return 0 ;}