帮忙 这个程序错在哪里啊 怎么运行不了??
#include<iostream>using namespace std;
class box
{public:
box(int h=10,int w=12,int len=15):height(h),width(w),length(len){}
int volume();
private;
int height;
int width;
int length;
};
int box::volume()
{return(height*width*length);
}
int main()
{box a[3]={
box(10,12,15),
box(15,18,20),
box(16,20,26)
};
cout<<a[0].volume()<<endl;
cout<<a[1].volume()<<endl;
cout<<a[2].volume()<<endl;
}