Reverse the order of the words in a sentence. Words are separated by one or more spaces; the output uses exactly one space between words and no leading or trailing spaces.
Input: one line of text.
Output: the words in reverse order.
Your program reads from stdin and prints to stdout.
Reverse the order of the words in a sentence. Words are separated by one or more spaces; the output uses exactly one space between words and no leading or trailing spaces.
Input: one line of text.
Output: the words in reverse order.
Your program reads from stdin and prints to stdout.