建立类cylinder

#include
using namespace std;




class cylinder
{
double radius;
double high;
double vol;
 public:
void radius_input()
{
cout<<"请输入圆柱体的半径:";
cin>>radius;
}
void high_input()
{
cout<<"请输入圆柱体的高:";
cin>>high;
}
void vol_out()
{
vol=3.14*radius*radius*high;
cout<<"该圆柱体的体积为:"< }
};
int main()
{
cylinder c1;
c1.radius_input();
c1.high_input();
c1.vol_out();
return 0;
}

你可能感兴趣的:(建立类cylinder)