#C11853. Reverse Words Order and Swap Cases
Reverse Words Order and Swap Cases
Reverse Words Order and Swap Cases
Given a sentence, reverse the order of the words and swap the cases of each character. For example, if the input is "Hello World", the output should be "wORLD hELLO". This problem tests your ability to manipulate strings, including splitting, reversing, and case conversion.
Details:
- Words are defined as sequences of characters separated by whitespace.
- Swapping cases means every lowercase letter becomes uppercase and every uppercase letter becomes lowercase.
- If the input is empty, the output should also be an empty string.
Examples:
Input: Hello World Output: wORLD hELLO</p>Input: Python is FUN Output: fun IS pYTHON
inputFormat
The input consists of a single line containing a sentence S, where S may include letters, numbers, and spaces.
Note: Input is provided via standard input (stdin).
outputFormat
Output a single line: the transformed sentence where the word order is reversed and each character's case is swapped.
Note: Output the result via standard output (stdout).
## sampleHello World
wORLD hELLO