6.1类实现立方体的体积

#include 
using namespace std;
class Box
{
private:
	int height;
	int weight;
	int length;
public:
	Box(int a,int b,int c):height(a),weight(b),length(c){}
	int s();
};
int Box::s()
{
	int d;
	d = height * length * weight;
	return d;
}
int main()
{
	Box b1(3, 4, 5);
	cout<

阿西,好简单

你可能感兴趣的:(1024程序员节)