Enter a character to determine if it is uppercase?

Updated on technology 2024-06-11
9 answers
  1. Anonymous users2024-02-11

    There are two bugs:

    1. The 6th line conversion statement: cn=ch+32, the writing position is wrong, and the ch has not yet entered the value when the program is executed to the 6th line.

    2. There is a logical error in line 9 of the program, and the input capital letters are not converted, so the output is still capital letters.

    I changed it for you, and the actual test works fine, ** as follows:

  2. Anonymous users2024-02-10

    The following is a paragraph of C++ programming language **, which is used to determine whether a character is an uppercase letter: cin>>c; if(c>='a' &&c<='z')cout<<"It's a capital letter";else cout<<"Not a capital letter";

  3. Anonymous users2024-02-09

    C language: Enter a character to determine whether it is an uppercase letter Yes Convert to lowercase letter No No conversion FYI include int main(){char a; } scanf ( c , a);if (a >= 'a' &&a

  4. Anonymous users2024-02-08

    You have to put cn=ch+32; This line is moved down 2 lines, and it must be read before it is judged.

  5. Anonymous users2024-02-07

    When the assignment statement of the C language is submitted to the computer for execution, only the assignment operation is completed, and the computer will not record the assignment formula to be used in the later program in the form of equations, therefore, cn=ch+32; This statement is calculated and assigned when the ch has not yet been assigned (the scanf statement has not been executed), which will cause the data in the ch to be unavoidable (in the case of debug, its value is equal to 0, and when exe is executed, it depends on the value of the data left over from the previous run of other programs at the position of the ch variable).

    From the program's point of view, you have judged the capital letter of ch, if the capitalization is not converted and calculated, only printing generally does not meet the requirements of the question.

    If the CH has an uppercase letter, then CH subtracts the ASCII code of the uppercase letter A to get the original letter of CH is the first few letters, and to convert it to the corresponding lowercase letter, you can add the ASCII code of the lowercase letter A.

    Suggestion: char ch;

    scanf("%c",&ch); if ( ch>='a' &&ch<='z' )

    printf("%c",ch);

  6. Anonymous users2024-02-06

    #include

    int main(void)

    char ch;

    scanf("%c",&ch);

    if(ch>='a' &&ch<='z')printf("%c",ch+32);

    elseprintf("%c",ch);

    return 0;

    scanf("%c",&ch);After the statement, it will not backtrack to assign a value to the cn, but will be executed downward; So what you write like this is garbled;

    According to the characteristics of the C language, the variable will not be cleared when allocating space, so cn is a residual garbage value, and it makes no sense to add 32 to the garbage value;

  7. Anonymous users2024-02-05

    Here's how to judge:

    1. To determine whether the string contains the uppercase letter a, you can use the formula =if(isnumber(find("a", a1)), there is","None")。

    2. The drop-down formula will find that the result containing the lowercase letter a is none, and the find function in the formula extracts the specified characters to be case-sensitive.

    3. If you want to determine whether it contains the letter A and is not case-sensitive, you can use the search function instead of the find function, the formula =if(isnumber(search("a", a1)), there is","None")。

    4. If you want to determine whether the cell contains one of the multiple specified characters, such as judging whether the cell contains one of the three characters of "big", "small" and "20", you can use the male split formula =if(or(isnumber(find(,A1))).","None")。

    5. The drop-down formula will find that as long as any of these three characters are included, the result is yes.

    6, and to judge whether these three characters are included at the same time, just change the or in the formula to and, the formula =if(and(isnumber(find(a1)))) has","None")。

    7. To determine how many of these three characters are included, you can use the formula =count(find(,a1)).

    8. To determine whether the cell contains the letter a, and no matter where it is in the string, it is not case-sensitive, you can use the formula =if(countif(a1,"*a*"Yes","None")。

    9. If you want to judge whether the four characters start with the letter a, the formula =if(countif(a1,"a???Yes","None") or =if(countif(a1,"a*"Yes","None")。

  8. Anonymous users2024-02-04

    In C, if the variable ch is a char quantity, you can use the following statement to determine the case:

    1、if(ch>='a' &ch<='z')printf("%c is an uppercase letter",ch)。

    2、if(ch>='a' &ch<='z')printf("%c is a lowercase letter",ch)。

    3、if(ch>='0' &ch<='9')printf("%c is a numeric character",ch)。

  9. Anonymous users2024-02-03

    Through the computer's keyboard and the input method installed by the system, you can input Chinese and English! However, in some cases, we enter English and always type English or uppercase English, so why can't we enter Chinese? There are several reasons for such problems:

    1. Chinese input method is not installed If your system does not have any Chinese input method installed, then you will not be able to input Chinese. Second, the input status of the Chinese input method is in the English input state Under normal circumstances, if the Chinese input method is enabled, it will be in the Chinese input state by default; However, due to a mistake in operation, the input state will be switched to the English input state, so no matter how you type, you will always enter English. Let's take a look at the icons below!

    This is a Chinese input method "smart ABC" icon, when in this state, then, the input must be Chinese; However, sometimes, due to careless operation, it was inadvertently switched to the English input method, see the figure below!

    Where the first icon of the Chinese input method toolbar is in the state of the capital letter a, the input will be English; To solve the problem, just click the a symbol with the mouse, switch to the state of Figure 1, and you can enter Chinese. 3. The system is in the state of capitalized letter input At the top of the keyboard, there is a key, and the English symbol on it is: "capslock", the function of the key is to turn on or off the uppercase English input state; Press the button, and in the upper right corner of the keyboard, there is a light that will glow, indicating that it is in the state of uppercase input; Press it again, if the light goes out, it means that it is in Chinese input state; If you always type in uppercase English when typing, you may wish to see if the light corresponding to the key is on; If it is on, press the capslock key once to turn it off, so that you can enter Chinese normally.

Related questions
9 answers2024-06-11

Hello, I'm glad you questioned. Take a look below:

is an escape character that represents one (1). >>>More

14 answers2024-06-11

1. Use Chinese as identifier, the premise is that the compiler supports Chinese as identifier, after C++11, the universal character name covers Chinese characters. >>>More

16 answers2024-06-11

stuff deletes characters of the specified length and inserts another set of characters at the specified starting point. >>>More

10 answers2024-06-11

The meaning of the title is said upstairs.,Here's a **.。 >>>More

17 answers2024-06-11

Let's talk about the idea first:

Get the last one within this string. location, which is the index. >>>More