/*
*copyright(c) 2016,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:李硕
*版本:v6.0
*
*问题描述:宣告主权
*输入描述:
*程序输出:
*/
#include <iostream>
using namespace std;
class Bulk
{
public:
void putin();
void volume()
{
cout<<"volume is:"<<length*width*heigth<<endl;
}
void areas()
{
cout<<"areas is:"<<length*width*2+length*heigth*2+width*heigth*2<<endl;
}
private:
double length;
double width;
double heigth;
};
void Bulk::putin()
{
cin>>length>>width>>heigth;
}
int main( )
{
Bulk b1,b2,b3;
b1.putin();
b2.putin();
b3.putin();
b1.areas();
b1.volume();
b2.areas();
b2.volume();
b3.areas();
b3.volume();
return 0;
}
<img src="https://img-blog.csdn.net/20160402145234494?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />