#C5320. Reverse Characters in Each Word

    ID: 48957 Type: Default 1000ms 256MiB

Reverse Characters in Each Word

Reverse Characters in Each Word

Given a sentence, reverse the characters in each word while preserving the original word order and whitespace. In other words, for each word represented as (w = c_1c_2\ldots c_n), the output should present it as (w' = c_n c_{n-1}\ldots c_1). For example, if the input is hello world, the output should be olleh dlrow.

inputFormat

The input consists of a single line containing a sentence. The sentence may include multiple words separated by spaces.

outputFormat

Output a single line where each word from the input has its characters reversed, while the order of the words remains unchanged.## sample

The quick brown fox
ehT kciuq nworb xof