电脑课实验六答案.pdfVIP

  • 1
  • 0
  • 约1.95千字
  • 约 3页
  • 2025-06-25 发布于山西
  • 举报

#includeiostream

usingnamespacestd;

classRectangle

{

protected:

doublelength;

doublewidth;

public:

Rectangle(doublel=0,doublew=0);

doubleGetArea();

};

Rectangle::Rectangle(doublel,doublew)

{

length=l;

width=w;

}

doubleRectangle::GetArea()

{

returnlength*width;

}

classCuboid:publicRectangle

{

protected:

doubleheight;

public:

Cuboid(doublel=0,doublew=0,doubleh=0);

文档评论(0)

1亿VIP精品文档

相关文档