In the code below, I tried to let the user input text, and it would output the first word. However, whenever I try the program to input the text, it doesn't output anything.
It most likely doesn't reach the cout statement. That's because there is no obvious way to exit from the loop. For example, below, the loop ends when the user types "stop".