C++ Programming Ch.11 Exercise 8 Solution
Problem: Circle ํด๋์ค๋ ๋ค์๊ณผ ๊ฐ๋ค. 1 2 3 4 5 6 7 8 class Circle { string name; int radius; public: Circle(int radius=1, string name="") { this->radius = radius; this->name = name; } }; Circle ํด๋์ค์ ๊ฐ์ฒด๋ฅผ ์ ์ถ๋ ฅํ๋ ๋ค์ ์ฝ๋์ Execution Result๋ฅผ ์ฐธ์กฐํ์ฌ <<, >> ์ฐ์ฐ์๋ฅผ ์์ฑํ๊ณ Circle ํด๋์ค๋ฅผ ์์ ํ๋ ๋ฑ ํ๋ก๊ทธ๋จ์ ์์ฑํ๋ผ. 1 2 3 Circle d, w; cin >> d >> w; // ํค๋ณด๋ ์ ๋ ฅ์ ๋ฐ์ ๊ฐ์ฒด d์ w๋ฅผ ์์ฑ cout << d << w << endl; // ๊ฐ์ฒด d, w ์ถ๋ ฅ Execution Result: ...