Description
A string that contains only uppercase and lowercase letters is now given, with no spaces and line breaks, which requires that the upper case be converted to lowercase, lowercase to uppercase, and then the swapped string will be output.
-
Input
-
The first line has only one integer m (m<=10), which indicates the number of test data groups.
-
The next M-line, each line has a string (the length does not exceed 100).
-
Output
-
Outputs the swapped strings, one row for each set of outputs.
-
Sample input
2 acmaccepted
Sample output
acmaccepted
Test code
1#include <stdio.h>2 3 intMain ()4 {5 intm;6 CharC;7scanf"%d", &m);8 GetChar ();9 while(m--)Ten { One while((c = GetChar ())! ='\ n') A { - if(c >='a'&&c <='Z') - { thePutchar (C-'a'+'A'); - } - Else - { +Putchar (C-'A'+'a'); - } + } Aprintf"\ n"); at } - return 0; -}
Uppercase and lowercase swaps