C++ 133제] 어서와! C++은 처음이지! CHAPTER 12. PROGRAMMING EXERCISE 1. p514
출처 : 반크_반크 20년 백서 참고풀이]#include using namespace std; class Shape { int x, y; public: Shape(int x, int y) :x(x), y(y) {} virtual double getArea() = 0; }; class Rect :public Shape { int s1, s2; public: Rect(int x, int y, int s1, int s2) :Shape(x, y), s1(s1), s2(s2) {} double getArea() { return (double)s1 * (double)s2; } }; class Triangle :public Shape { double width, height; ..
2024. 12. 16.