#include<iostream>
using namespace std;
class cylinder
{
double r;
double h;
double v;
public:
void radius_input()
{
cout<<"请输入圆柱体的半径r:";
cin>>r;
}
void high_input()
{
cout<<"请输入圆柱体的高度h:";
cin>>h;
}
void vol_out()
{
v=3.14*r*r*h;
cout<<"该圆柱体的体积为:"<<v<<endl;
}
};
int main()
{
cylinder c1;
c1.radius_input();
c1.high_input();
c1.vol_out();
return 0;
}
3.23
最新推荐文章于 2019-03-22 20:57:34 发布