#include<iostream>
using namespace std;
class cylinder{
public:
double V()
{return 3.14*r*r*h;}
void haha(double a,double b)
{r=a,h=b;}
void show();
private:
double r,h;
};
void cylinder::show()
{cout<<"V="<<V()<<endl;}
int main()
{
cylinder c1;
c1.haha(2,3);
c1.show;
cylinder c2;
c2.haha(4,5);
c2.show;
return 0;
}
3.23
最新推荐文章于 2022-04-25 18:52:45 发布