๐Ÿ’ป Dev & CSC++ Programming

C++ Programming Ch.3 Exercise 8 Solution

Problem: int ํƒ€์ž…์˜ ์ •์ˆ˜๋ฅผ ๊ฐ์ฒดํ™”ํ•œ Integer ํด๋ž˜์Šค๋ฅผ ์ž‘์„ฑํ•˜๋ผ. Integer์˜ ๋ชจ๋“  ๋ฉค๋ฒ„ ํ•จ์ˆ˜๋ฅผ ์ž๋™ ์ธ๋ผ์ธ์œผ๋กœ ์ž‘์„ฑํ•˜๋ผ. Integer ํด๋ž˜์Šค๋ฅผ ํ™œ์šฉํ•˜๋Š” ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include #include using namespace std; int main() { Integer n(30); cout << n.get() << ' '; // 30 ์ถœ๋ ฅ n.set(50); cout << n.get() << ' '; // 50 ์ถœ๋ ฅ Integer m("300"); cout << m.get() << ' '; // 300 ์ถœ๋ ฅ cout << m.isEven(); // true(์ •์ˆ˜๋กœ 1) ์ถœ๋ ฅ } Objective & Hints: ...

March 3, 2020 ยท 2 min ยท Sobamemil