← 返回 amazon 的题目列表Reverse Words in a String
类型:online_judge
amazon
Given an input string consisting of spaces and letters, reverse each word in the string while retaining the original order of the words. Assume the input string contains only ASCII characters. All words are composed of non-whitespace characters. Each word contains at least one character, and there are no leading or trailing spaces in the input string.
Example:
Input: "hello world" Output: "olleh dlrow"
Input: "I love amazon robotics" Output: "I evol nozam scitobor"
Example
Input
hello world