Array-05. String Letter case conversion (10)

Source: Internet
Author: User

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 <iostream>2#include <stdio.h>3#include <math.h>4#include <string>5#include <stdlib.h>6 7 using namespace:: STD;8 9 intMain () {Ten      One       intCount=0; A       Charc[ A],temp; -       intI=0; -        while((Temp=getchar ())! ='#') the       {  -c[i]=temp; -i++; -count++; +       } -        for(intI=0; i<count;i++) +       { A           if(c[i]<='Z'&&c[i]>='a') at           { -c[i]=c[i]+'A'-'a'; -           } -           Else if(c[i]<='Z'&&c[i]>='A') -           { -c[i]=c[i]+'a'-'A'; in           } -           Else{ to           } +       } -c[count]=' /'; the puts (c); *       return 0; $}

Array-05. String Letter case conversion (10)

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.