color.hh 287 B

123456789101112131415161718192021222324
  1. #ifndef COLOR_H
  2. #define COLOR_H
  3. class Color{
  4. public:
  5. virtual void paint() = 0;
  6. };
  7. class Yellow: public Color{
  8. public:
  9. void paint() override{
  10. std::cout << "Yellow\n";
  11. };
  12. };
  13. class Pink: public Color{
  14. public:
  15. void paint() override{
  16. std::cout << "Pink\n";
  17. };
  18. };
  19. #endif