1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
class _shape { public: virtual void show_area() = 0; }; class _rectangle : public _shape { private: int w, h; public: _rectangle(int width, int height); void show_area(); }; class _circle : public _shape { private: int r; public: _circle(int radius); void show_area(); };