#include<iostream>
#include<cstring>
using namespace std;
class Cylinder {
double r;
double h;
double vol;
public:
void r_h_input()
{
cout<<"please input r,h:";
cin>>r>>h;
}
void v_volume_out()
{vol=3.14*r*r*h;
printf("The volume of cylinder is:%f\n",vol);
}
};
int main()
{ Cylinder v1;
v1.r_h_input();
v1.v_volume_out();
return 0;
}
#include<cstring>
using namespace std;
class Cylinder {
double r;
double h;
double vol;
public:
void r_h_input()
{
cout<<"please input r,h:";
cin>>r>>h;
}
void v_volume_out()
{vol=3.14*r*r*h;
printf("The volume of cylinder is:%f\n",vol);
}
};
int main()
{ Cylinder v1;
v1.r_h_input();
v1.v_volume_out();
return 0;
}