#include <iostream>
using namespace std;
class Table                                      
{
private:
	int length;
	int width;
	int height;                                  
public:
	int volume();                               //声明计算体积的成员函数
	Table(int l=10,int w=10,int h=10);              //声明默认构造函数    
};
int main()
{
Table t1;                                  //对象t1没有实参
cout<<"the volume of the t1 is:"<<t1.volume()<<endl; 
	Table t2(20);                              //对象t2有一个实参
	cout<<"the volume of the t2 is:"<<t2.volume()<<endl; 
	Table t3(20,30);                            //对象t3有2个实参
	cout<<"the volume of the t2 is:"<<t3.volume()<<endl; 
	return 0;
}
int Table::volume()                              //定义体积函数
{
	return(length*width*height);
}

Table::Table(int l,int w,int h)                       //定义默认构造函数
{
	length=l;
	width=w;
	height=h;
}

