1234567891011121314151617181920212223242526272829 |
- #include <iostream>
- #include "shape.hh"
- #include "color.hh"
- int main(){
- Color *c;
- Shape *s;
- std::cout << "Pick a color:\n"
- << "(1) - Yellow\n"
- << "(2) - Pink\n";
- int opt;
- std::cin >> opt;
- if (opt == 1){
- c = new Yellow;
- } else if (opt == 2){
- c = new Pink;
- }
- std::cout << "Pink a shape:\n"
- << "(1) - Circle\n"
- << "(2) - Square\n";
- std::cin >> opt;
- if (opt == 1){
- s = new Circle(*c);
- } else if (opt == 2){
- s = new Square(*c);
- }
- s->draw();
- }
|