using namespace std;
class Cuboid
{
public:
Cuboid()
{
Input();
}
Cuboid(float l,float w,float h)
{
length=l;
width=w;
height=h;
}
float GetVolume()
{
return length*width*height;
}
void Input()
{
cout<<"请输入长方体的长:";
cin>>length;
cout<<"请输入长方体的宽:";
cin>>width;
cout<<"请输入长方体的高:";
cin>>height;
}
protected:
float length;
float width;
float height;
};
main()
{
Cuboid a,b,c;
float va=a.GetVolume();
float vb=b.GetVolume();
float vc=c.GetVolume();
cout<<"第一个长方体的体积是:"<