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}