#include <iostream>
using namespace std;
class Cube {
// write your code here......
private://成员变量一般不允许外界直接访问
int length;
int width;
int height;
public://外界需要直接访问这些方法
/*
void setLength(int l)
{
length=l;
}
*/
//若形参名与实参名一样,则要使用this指针
void setLength(int length)
{
this->length=length;
}
int getLength()
{
return length;
}
void setWidth(int w)
{
width=w;
}
int getWidth()
{
return width;
}
void setHeight(int h)
{
height=h;
}
int getHeight()
{
return height;
}
int getArea()
{//直接使用成员变量进行运算,在同一个类内部
return 2*(length*width+length*height+width*height);
}
int getVolume()
{
return length*width*height;
}
};
int main() {
int length, width, height;
cin >> length;
cin >> width;
cin >> height;
Cube c;
c.setLength(length);//说明不允许外界直接访问成员变量
c.setWidth(width);//需要使用set,get方法来赋值和取值
c.setHeight(height);
cout << c.getLength() << " "
<< c.getWidth() << " "
<< c.getHeight() << " "
<< c.getArea() << " "
<< c.getVolume() << endl;
return 0;
}