Huawei trial (1)

Source: Internet
Author: User

Description
Enter a string, delete all numbers, change all uppercase letters to lowercase letters, and output
Input Description: A string with no space. It ends with a carriage return and has a length of <= 20
Output Description: a string that is the result required by the question.
Input example: aabb13a
Output example: aabba
Solution: Simulate the requirement of a question. If you encounter a number, you can skip the process without outputting it. If you encounter an uppercase letter, you can change it to lowercase.

# Include <string> # include <iostream> using namespace STD; void main () {string s; CIN> S; int Len; int I; Len = S. size (); for (I = 0; I <Len; I ++) {If (s [I]> = '0' & S [I] <= '9') continue; else if (s [I]> = 'A' & S [I] <= 'Z ') s [I] = s [I]-'A' + 'a'; cout <s [I];} cout <Endl; // Add this sentence at the end of the Question Based on Input and Output}

 

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.