main.cc 503 B

1234567891011121314151617181920212223242526272829
  1. #include <iostream>
  2. #include "shape.hh"
  3. #include "color.hh"
  4. int main(){
  5. Color *c;
  6. Shape *s;
  7. std::cout << "Pick a color:\n"
  8. << "(1) - Yellow\n"
  9. << "(2) - Pink\n";
  10. int opt;
  11. std::cin >> opt;
  12. if (opt == 1){
  13. c = new Yellow;
  14. } else if (opt == 2){
  15. c = new Pink;
  16. }
  17. std::cout << "Pink a shape:\n"
  18. << "(1) - Circle\n"
  19. << "(2) - Square\n";
  20. std::cin >> opt;
  21. if (opt == 1){
  22. s = new Circle(*c);
  23. } else if (opt == 2){
  24. s = new Square(*c);
  25. }
  26. s->draw();
  27. }