#include "stdio.h"
#include "iostream.h"
class shape
{
public:
void Print(){ cout <<"I'm shape .\n";}
void draw(){cout <<"I'm drawing .\n";}
void move(){cout <<"I'm moving .\n";}
void hide(){cout <<"I'm hiding .\n";}
void show(){cout <<"I'm showing .\n";}
};
class Quadrangle : public shape
{
public:
void Print(){ cout << "I'm Quadrangle\n"; }
};
class Diamond : public Quadrangle
{
public:
void Print(){ cout << "I'm Diamond.Diamond is Quadrangle\n"; }
};
int main()
{
Diamond d;
d.draw();
return 0;
}
通过