The cin input stream is buffered. After entering each value such as go or answ, there will remain at least a trailing newline character '\n' in the buffer.
If you clear the buffer after the cin, then the next input operation becomes more guaranteed to behave in a predictable way.
I thought I explained it, by way of a working example. Once you understand the example I gave, you should be equipped to apply that knowledge to other situations.