C++之求长方体的体积

#include <iostream>


using namespace std;


class Valume
{
public:
void get();
void display();
private:
double length;
double width;
double height;
};


void Valume::get()
{
cin>>length>>width>>height;
}


void Valume::display()
{
cout<<"Valume="<<length*width*height<<endl;
}


int main()
{
Valume v1;
v1.get();
v1.display();


return 0;
}
展开阅读全文

没有更多推荐了,返回首页