C++ Programming Ch.5 Exercise 4 Solution
Problem: μλμ κ°μ΄ μνμ΄ μ£Όμ΄μ§ bigger()λ₯Ό μμ±νκ³ μ¬μ©μλ‘λΆν° 2κ°μ μ μλ₯Ό μ λ ₯λ°μ ν° κ°μ μΆλ ₯νλ main()μ μμ±νλΌ. bigger()λ μΈμλ‘ μ£Όμ΄μ§ a, bκ° κ°μΌλ©΄ true, μλλ©΄ falseλ₯Ό 리ν΄νκ³ ν° μλ bigμ μ λ¬νλ€. 1 bool bigger(int a, int b, int& big); Execution Result: Objective & Hints: μ°Έμ‘°μ μν νΈμΆ μ°μ΅ Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include using namespace std; bool bigger(int a, int b, int& big){ if(a==b) return true; else { if(a>b) big = a; else big = b; return false; } } int main() { int a, b, big; cout << "λκ°μ μ μλ₯Ό μ λ ₯νμΈμ>>"; cin >> a >> b; if(!bigger(a, b, big)) cout << "ν° μλ : " << big; else cout << "λ μ μκ° κ°μ΅λλ€."; } Explanation: ...