#K33527. Reverse Words in a Sentence

    ID: 25107 Type: Default 1000ms 256MiB

Reverse Words in a Sentence

Reverse Words in a Sentence

Given a sentence, your task is to reverse each individual word while keeping the word order unchanged. For example, if the input is hello world, the output should be olleh dlrow.

You are required to read the input from standard input (stdin) and output the result to standard output (stdout). The sentence may contain multiple words separated by spaces. If the input is an empty string, the output should also be an empty string.

inputFormat

The input consists of a single line containing a sentence. Words are separated by spaces. The sentence may be empty.

outputFormat

Output the transformed sentence where each word is reversed individually but the original order of the words is maintained.## sample

hello world
olleh dlrow