#C8422. Reverse Case Conversion
Reverse Case Conversion
Reverse Case Conversion
You are given a string s
. Your task is to convert each uppercase letter in s
to its corresponding lowercase letter and each lowercase letter to its corresponding uppercase letter. Non-alphabetic characters should remain unchanged.
The transformation can be described mathematically as follows:
For each character \( c \) in the string:
if \( c \) is an uppercase letter, replace it with \( \text{tolower}(c) \);
if \( c \) is a lowercase letter, replace it with \( \text{toupper}(c) \);
otherwise, \( c \) remains unchanged.
Input will be provided via standard input (stdin) and output should be written to standard output (stdout).
inputFormat
The input consists of a single line containing the string s
. The string may contain spaces, digits, and special characters.
outputFormat
Output the transformed string after reversing the case of each alphabetic character.
## sampleHello World!
hELLO wORLD!