// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
using namespace std;
class Cube_volume
{
public:
void set_cube();
void volume_cube();
void shou_cube();
private:
int length;
int width;
int height;
int volume;
};
void Cube_volume::set_cube()
{
cout<<"Please enter cube length, width, height: ";
cin>>length>>width>>height;
}
void Cube_volume::volume_cube()
{
volume=length*width*height;
}
void Cube_volume::shou_cube()
{
cout<<"Volume= "<
int main()
{
Cube_volume cube[3];
int i;
for (i=0; i<3; i++){
cube[i].set_cube();
cube[i].volume_cube();
cube[i].shou_cube();
}
system("pause");
return 0;
}
写3个函数修改长宽高,写一个函数计算并返回体积
这么简单自己写
!!!