29 lines
611 B
C
29 lines
611 B
C
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
|
||
|
class DrawApi
|
||
|
{
|
||
|
public:
|
||
|
DrawApi(){}
|
||
|
virtual ~DrawApi(){}
|
||
|
virtual void drawCircle(int radius, int x, int y) = 0;
|
||
|
};
|
||
|
|
||
|
class RedCircle: public DrawApi
|
||
|
{
|
||
|
public:
|
||
|
void drawCircle(int radius, int x, int y)
|
||
|
{
|
||
|
cout << "drawing circle [ color: red, radius: " << radius << ", x: " << x << ", y: " << y << " ]" << endl;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
class GreenCircle: public DrawApi
|
||
|
{
|
||
|
public:
|
||
|
void drawCircle(int radius, int x, int y)
|
||
|
{
|
||
|
cout << "drawing circle [ color: green, radius: " << radius << ", x: " << x << ", y: " << y << " ]" << endl;
|
||
|
}
|
||
|
};
|