/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:王帅
*版本:v6.0
*
*问题描述:长方形
*输入描述:无
*程序输出:
*/
#include<iostream>
using namespace std;
class Bulk
{
private:
int length;
int width;
int height;
public:
Bulk(int l,int w,int h):length(l),width(w),height(h){}
void set()
{
cin>>length>>width>>height;
}
int volume()
{
return length*width*height;
}
int areas()
{
return 2*(length*width+length*height+width*height);
}
};
int main()
{
Bulk a(1,2,3),b(4,5,6),c(7,8,9);
a.set();
b.set();
c.set();
cout<<a.volume()<<" "<<a.areas()<<endl;
cout<<b.volume()<<" "<<b.areas()<<endl;
cout<<c.volume()<<" "<<c.areas()<<endl;
}