Well that is not much of an improvement!
You have left the get() in. You haven't bothered to print out
ch to find that it is always the FIRST character on the next line.
You didn't read what getline does. It consumes the '\n' character.
You need to either (a) learn how to use the debugger.
(b) write a lot of std::cout<<
statements.
I asked three questions:
(A) a to put getline (well you sort of have)
(B) to find out how many times it goes through the loop
(C) the line that your code failed to read.
You failed on 2/3. I used to use logarithm marking when I had students so that makes you on ln(1)/ln(3) == 0% More effort required.