#C5678. Reverse Each Word
Reverse Each Word
Reverse Each Word
In this problem, you are given a string containing words separated by spaces. Your task is to reverse each individual word while preserving the original order and the exact spacing of the string.
For example, if the input is code assessment task
, then the output should be edoc tnemssessa ksat
.
inputFormat
A single line string consisting of words separated by spaces. The string may contain leading, trailing, or multiple intermediate spaces.
outputFormat
A single line string where each word is reversed while preserving the original spacing.## sample
code assessment task
edoc tnemssessa ksat