#include
using namespace std;
class Box
{
public:
Box()
{
Length=40;
Width=20;
High=25;
cout<<"箱子的长是:"< };
Box(int l,int w,int h)
{
num=0;
Length=l;
Width=w;
High=h;
cout<<"箱子的长是:"< };
void show();
void Load(int n);
void Check();
void Discard();
private:
int num;
int Length;
int Width;
int High;
};
void Box::Load(int n)
{
num=n;
cout<<"装入"<}
void Box::Check()
{
if(num!=0)
cout<<"箱子里面有"< else
cout<<"箱子是空的!"<}
void Box::Discard()
{
if(num!=0)
cout<<"倒出箱子里面的"< else
cout<<"箱子是空的!摧毁箱子!"<}
int main()
{
Box box1;
Box box2(10,14,30);
box1.Load(23);
box1.Check();
box2.Check();
box1.Discard();
box2.Discard();
return 0;
}
--------------------next---------------------
阅读(1374) | 评论(0) | 转发(0) |