Uppercase and lowercase swaps

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.