#include<iostream>
using namespace std;
class Rectangle
{
// 派生类声明
// class ColorRectangle: publicRectangle
class ColorRectangle: private Rectangle
{
void main()
{
using namespace std;
class Rectangle
{
private:
int width;int height;
public:
};void InitRect(int w = 0, int h = 0){width = w;height = h;}int GetWidth(){ return width; }int GetHeight(){return height;}
// 派生类声明
// class ColorRectangle: publicRectangle
class ColorRectangle: private Rectangle
{
private:
int color;
public:
};void InitColorRect(int w = 0, int h = 0, int c = 0){InitRect(w, h);color = c;}// Not ColorRectangle::GetWidth();int GetWidth(){ return Rectangle::GetWidth(); }
// Not ColorRectangle::GetHeight();int GetHeight(){return Rectangle::GetHeight();}
int GetColor(){ return color; }
void main()
{
ColorRectangle crt; // crt: color-rectangle}
crt.InitColorRect(3, 5, 8);
cout << "Width\t= " << crt.GetWidth() << endl;
cout << "Height\t= " << crt.GetHeight() << endl;
cout << "Color\t= " << crt.GetColor() << endl;