1009. Reverse talk (20) Time Limit 400 ms memory limit 32000 KB Code The length is limited to 8000. Program Standard Author: Chen, Yue
To give an English sentence, you must write a program to output all the words in the sentence in reverse order.
Input Format:The test input contains a test case that contains a string of no more than 80 characters in a row. A string consists of several words and spaces. A word is a string consisting of uppercase and lowercase letters. Words are separated by one space, enter no extra spaces at the end of the sentence.
Output Format:The output of each test case occupies one line and the inverted sentence is output.
Input example:
Hello world here I come
Output example:
Come I here world Hello
# include
# include
# include
using namespace STD; int main () {bool flag = false; stack
S; string STR; while (CIN> Str) s. push (STR); While (! S. empty () {If (FLAG) cout <""; else flag = true; cout