#include <iostream>
using namespace std;
class Box
{
public:
Box(int ,int ,int );
int volume();
private:
int height;
int width;
int length;
};
Box::Box(int h,int w,int len)
{
height=h;
width=w;
length=len;
}
int Box::volume()
{
return(height*width*length);
}
int main()
{
Box box1(12,23,32);
cout<<"wewwex is"<<box1.volume()<<endl;
Box box2(12,23,45);
cout<<"sdd is"<<box2.volume()<<endl;
return 0;
}
柱体体积与构造函数
最新推荐文章于 2023-01-01 13:21:09 发布