题目:790. 数的三次方根
注意:读入用%lf,输出用%f
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=1e5+10;
int main(){
double n;
scanf("%lf",&n);
//cout<<n<<endl;
double l=-10000,r=10000;
while(r-l>1e-8){
double mid=(l+r)/2;
if(n>=mid*mid*mid) l=mid;
else r=mid;
//cout<<l<<" "<<r<<endl;
}
printf("%.6f",l);
return 0;
}