#C12367. Reverse Words in a String
Reverse Words in a String
Reverse Words in a String
Given a string, your task is to reverse the characters in each word while preserving the original order of the words. All sequences of whitespace are treated as a single delimiter. For instance, if the input is Hello World
, the output should be olleH dlroW
.
Note: An empty string should produce an empty output.
inputFormat
The input is provided via standard input (stdin) as a single line containing a string. The string may consist of multiple words separated by one or more whitespace characters. It can also be an empty string.
outputFormat
Print the modified string to standard output (stdout) where each word has its characters reversed, but the order of the words remains unchanged. Ensure that the words are separated by a single space.
## samplehello
olleh