小技巧:求立方根 #include<camth> double x; ///x<0,返回是float型 pow(-x,1.0/3.0); ///x>=0,返回是float型 pow(x,1.0/3.0); printf("%.3f",pow(x,1.0/3.0)); ///无论x正负,返回是float型 cbrt(x); printf("%.3f",cbrt(x)); ///格式是.f