#include
using namespace std;
class Cuboid {
private :
int length;
int width;
int height;
public :
Cuboid() {length = width = height = 0;}
Cuboid(int l,int w,int h) {
length = l;
width = w;
height = h;
}
int Volume() { return length * width * height; }
int SuperficialArea() {
return 2 * (length * width + width * height + height * length);
}
void Show() {
cout << "长 " << length << endl;
cout << "宽 " << width << endl;
cout << "高 " << height << endl;
}
};
int main() {
int len,w,h;
cout << "输入长方体的长、宽、高(空格隔开) : ";
cin >> len >> w >> h;
Cuboid Ca(len,w,h),Cb;
cout << "Ca属性 :\n";
Ca.Show();
cout << "体积 : " << Ca.Volume() << endl;
cout << "
表面积 : " << Ca.SuperficialArea() << endl;
cout << "Cb属性 :\n";
Cb.Show();
cout << "体积 : " << Cb.Volume() << endl;
cout << "表面积 : " << Cb.SuperficialArea() << endl;
return 0;
}