#C14147. Reverse Words in a Sentence
Reverse Words in a Sentence
Reverse Words in a Sentence
You are given a sentence as input. Your task is to reverse each word in the sentence while keeping the original order of the words unchanged.
For example, if the input is Hello World
, the expected output is olleH dlroW
.
Edge cases include an empty string or a single-character string.
inputFormat
The input consists of a single line containing a sentence. Words are separated by a single space. The sentence may be empty.
outputFormat
The output should be the sentence after reversing each word individually while preserving the original order of the words. Words should be separated by a single space.
## sampleHello World
olleH dlroW