#include using namespace std;class Box{public:Box(int a,int b,int c){height=a;width=b;length=c;}Box(const Box &b){height=b.height;width=b.width;length=b.height;}int volume(){return(height*width*length);}private:int height;int width;int length;};int m
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 13:59:58
#include using namespace std;class Box{public:Box(int a,int b,int c){height=a;width=b;length=c;}Box(const Box &b){height=b.height;width=b.width;length=b.height;}int volume(){return(height*width*length);}private:int height;int width;int length;};int m
#include
using namespace std;
class Box
{
public:
Box(int a,int b,int c)
{
height=a;
width=b;
length=c;
}
Box(const Box &b)
{
height=b.height;
width=b.width;
length=b.height;
}
int volume()
{
return(height*width*length);
}
private:
int height;
int width;
int length;
};
int main()
{
Box box1(15,30,25);
cout
#include using namespace std;class Box{public:Box(int a,int b,int c){height=a;width=b;length=c;}Box(const Box &b){height=b.height;width=b.width;length=b.height;}int volume(){return(height*width*length);}private:int height;int width;int length;};int m
Box(const Box &b)
{
height=b.height;
width=b.width;
length=b.height; //这里应该是length=b.length
}