C++ Programming Ch.11 Exercise 4 Solution
Problem: ν μ€μ 'μμ΄λ¬Έμ₯;νκΈλ¬Έμ' νμμΌλ‘ ν€ μ λ ₯λ λ, cin.ignore()λ₯Ό μ΄μ©νμ¬ ';'μ΄μ μ μ λ ₯λ λ¬Έμμ΄λ§ μΆλ ₯νλ νλ‘κ·Έλ¨μ μμ±νλΌ. μλμμ ^Z(ctrl-z) ν€λ μ λ ₯ μ’ λ£λ₯Ό λνλ΄λ ν€μ΄λ©°, cin.get()μ EOFλ₯Ό 리ν΄νλ€. Execution Result: Objective & Hints: cin.get(), EOF, cin.ignore() νμ© Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include using namespace std; int main() { int ch; while( (ch = cin.get()) != EOF ) { if(ch == ';'){ cout.put('\n'); cin.ignore(100, '\n'); } else cout.put(ch); } } Explanation: ...