the program executes properly the first time
but if the user any key to continue it skips the input and displays #1,#2, and #3 without asking the user to input another sentence
i need help solving this
Your cin>> is probably leaving an enter key press in the buffer, so the next time you try to read a string, it sees that enter key as the end of the user's input.
u define a word : some character that eather have nothing, or have a spice befor and after them.
(example this is an end,And this a begin. in this case u read end,And as one word)
so u could make a function that counts 1 for every set of characters wich have a space before and after. and define the special cases, start of the senence and end of it.