二分查找法

#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    double x;
    while(cin>>x){
        double out;
       double left,right;
        if(x>=0&&x<1) {
            left = x;
            right = 1.0;
        }
        else if(x<0&&(x>-1)){
            right = x;
            left = -1.0;
        }
        else if (x>=1){
            left = 1.0;
            right = x;
        }
        else if (x<=1){
            left = x;
            right = -1.0;
        }
        while((right-left)>0.01){
            out = (right+left)/2;
            if(out*out*out>x) right =out;
            else left = out;
            
        }
        
        cout<<fixed<<setprecision(1)<<out<<endl;
    }
}