
此题题目听繁琐,但是看完了很简单,就是给你个圆柱的低和高,然后还有去除的那部分体积,然你算中间剩余的立方体的高
1 #include <iostream>
2 #include <cmath>
3 #include <iomanip>
4 using namespace std;
5 const double PI=3.14159265358979323846;
6 int main(){
7 double dd,v,d,t;
8 cin>>dd>>v;
9 while(!(dd==0&&v==0)){
10 t=pow(dd,3)-6*v/PI;
11 d=pow(t,1.0/3);
12 cout<<setprecision(3)<<fixed;
13 cout<<d<<endl;
14 cin>>dd>>v;
15 }
16 return 0;
17 }

浙公网安备 33010602011771号