38 lines
463 B
C++
38 lines
463 B
C++
#include <iostream>
|
|
using namespace std;
|
|
|
|
class Shape
|
|
{
|
|
public:
|
|
Shape(){}
|
|
virtual ~Shape(){}
|
|
virtual void draw() = 0;
|
|
};
|
|
|
|
class Square: public Shape
|
|
{
|
|
public:
|
|
void draw()
|
|
{
|
|
cout << "draw Square" << endl;
|
|
}
|
|
};
|
|
|
|
class Circle: public Shape
|
|
{
|
|
public:
|
|
void draw()
|
|
{
|
|
cout << "draw Circle" << endl;
|
|
}
|
|
};
|
|
|
|
class Rectangle: public Shape
|
|
{
|
|
public:
|
|
void draw()
|
|
{
|
|
cout << "draw Rectangle" << endl;
|
|
}
|
|
};
|