1 #include <bits/stdc++.h> 2 using namespace std; 3 int main () { 4 double n; 5 cin >> n; 6 double l = -100, r = 100; 7 while (r - l > 1e-8) { //当区间足够小的时候 8 double mid = (l + r) / 2; 9 if (mid * mid * mid >= n) { 10 r = mid; 11 } else { 12 l = mid; 13 } 14 } 15 cout << fixed << setprecision(6) << l << endl; 16 return 0; 17 }