Array-05. String Letter Case Conversion

Source: Internet
Author: User

Array-05. String Letter case conversion (10) time limit MS Memory limit 65536 KB code length limit 8000 B procedure StandardAuthor Zhang Tong Hongyu (Zhejiang University)

Enter a string ending with #, which requires all lowercase letters to be converted to uppercase letters, all uppercase and lowercase, and the other characters unchanged.

Input format:

The input gives a non-empty string that has a length of not more than 40, ending in #, in a row.

Output format:

Output the converted string as required on a single line.

Input Sample:
Hello world! 123#
Sample output:
HELLO world! 123
1#include <stdio.h>2#include <math.h>3#include <stdlib.h>4#include <string.h>5 intMain ()6 {7     Charstr[ -];8 gets (str);9     inti;Ten      for(i =0; I < strlen (str); i++) One     { A         if(Str[i] >='a'&& Str[i] <='Z') -Str[i] = Str[i] +'A'-'a'; -         Else if(Str[i] >='A'&& Str[i] <='Z') theStr[i] = Str[i] +'a'-'A'; -     } -      for(i =0; Str[i]! ='#'; i++) -     { +printf"%c", Str[i]); -     } +printf"\ n"); A     return 0; at}

Array-05. String Letter Case Conversion

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.