求三个长方体的体积

#include
using namespace std;
class Box
{
public:
long length;
long width;
long height;
void  voiume();
};
void Box::voiume()
{
cout<<"the voiume is:"< cout< }
int main()
{
  Box box1,box2,box3;
  cout<<"box1:"<   cin>>box1.height>>box1.length>>box1.width;
  cout<<"box2:"<   cin>>box2.height>>box2.length>>box2.width;
  cout<<"box3:"<   cin>>box3.height>>box3.length>>box3.width;
  box1.voiume();
  box2.voiume();
  box3.voiume();
}



你可能感兴趣的:(c++)