C++ Programming Ch.2 Exercise 6 Solution
Problem: λ¬Έμμ΄μ λ κ° μ λ ₯λ°κ³ λ κ°μ λ¬Έμμ΄μ΄ κ°μμ§ κ²μ¬νλ νλ‘κ·Έλ¨μ μμ±νλΌ. λ§μΌ κ°μΌλ©΄ "κ°μ΅λλ€", μλλ©΄ "κ°μ§ μμ΅λλ€"λ₯Ό μΆλ ₯νλΌ. Objective & Hints: 곡백 μμ΄ μ λ ₯λ λ¬Έμμ΄ μ½κΈ° (λΉμΉΈ μμ΄ μ λ ₯) Execution Result: Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include #include using namespace std; int main() { char pw1[100]; char pw2[100]; cout << "μ μνΈλ₯Ό μ λ ₯νμΈμ>>"; cin.getline(pw1,100); cout << "μ μνΈλ₯Ό λ€μ ν λ² μ λ ₯νμΈμ>>"; cin.getline(pw2,100); if(strcmp(pw1,pw2)==0) cout << "κ°μ΅λλ€"; else cout << "κ°μ§ μμ΅λλ€"; return 0; } Explanation: ...