Thanks. I compiled this. The user still has to press the enter key twice before the output appears.
I want users to be able to press the enter only once.
like when i input
word1 word2
and then press enter, i don't have to press enter again.
OK. So the problem is. When I run this, by reading the code, I know that I have to enter my input, so what I do is I enter my input and press enter once.
Then, I immediately enter my second input, then I press enter once again.
Then nothing happens, so I press enter again. NOthing happens again. So I press enter again. The output finally appears. But I can see that only the firs word is being displayed. So when my input is something like this
(spaces means endlines, I mean spaces after word 1 and word 2 means I pressed enter)
word 1
word 2
word1
However if I input something like this
word 1
word 2
word1
word2
Is this clear? I have to press enter twice. I only want to have to press the enter once and the next code will be executed. Is that possible?