πŸ’» Dev & CSC++ Programming

C++ Programming Ch.8 Exercise 4 Solution

Problem: 문제 3~4에 μ μš©λ˜λŠ” 2차원 μƒμ˜ ν•œ 점을 ν‘œν˜„ν•˜λŠ” Point ν΄λž˜μŠ€κ°€ μžˆλ‹€. 1 2 3 4 5 6 7 8 9 class Point { int x,y; public: point(int x, int y) { this->x = x; this->y = y; } int getX(){ return x; } int getY(){ return y; } protected: void move(int x, int y) { this->x = x; this->y = y; } }; λ‹€μŒ main() ν•¨μˆ˜κ°€ μ‹€ν–‰λ˜λ„λ‘ Point 클래슀λ₯Ό μƒμ†λ°›λŠ” ColorPoint 클래슀λ₯Ό μž‘μ„±ν•˜κ³ , 전체 ν”„λ‘œκ·Έλž¨μ„ μ™„μ„±ν•˜λΌ. ...

March 9, 2020 Β· 2 min Β· Sobamemil