#K72872. Reverse Words in a Sentence
Reverse Words in a Sentence
Reverse Words in a Sentence
You are given a sentence comprised of words separated by exactly one space. Your task is to reverse the order of the words. For example, if the input sentence is hello world
, the output must be world hello
. This problem assesses your ability to manipulate strings and arrays.
Note: The words in the sentence are separated by a single space. The solution should read input from standard input (stdin) and print the result to standard output (stdout).
inputFormat
The input consists of a single line containing a sentence. The sentence includes words separated by exactly one space.
outputFormat
Output the sentence with its words in reverse order. The output should be a single line corresponding to the modified sentence.
## samplehello world
world hello