Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C++ input level: B requires jumping out of 80 to 90. Why do I get an error when I enter B? Ask the expert to answer the following procedures. How to change it requires the use of switching language.
C++ input level: B requires jumping out of 80 to 90. Why do I get an error when I enter B? Ask the expert to answer the following procedures. How to change it requires the use of switching language.
The constant expression after case does not match the expression in the bracket of switch ().

The expression after case can be plastic, character or live enumeration, but your a, b, c and d are undefined.

int main(void)

{

int I;

Carbonization grade;

Double integral;

for(I = 1; I < = 6; i++)

{

printf("[A]Select 1 \ n ");

printf("[B]Select 2 \ n ");

printf("[C]Select 3 \ n ");

printf("[D]Select 4 \ n ");

printf("[E]Select 5 \ n ");

printf("[0]exit \ n ");

Printf ("input grade:");

Scanf("%c ",& grade);

if(Grade ==“”)

Break;

Switch (grade)

{

Case "a": printf ("90 to100 \ n"); Break;

Case "b": printf ("80 to 90 \ n"); Break;

Case "c": printf ("70 to 80 \ n"); Break;

Case "d": printf ("60 to 70 \ n"); Break;

Case 'E': printf("0 to 59 \ n "); Break;

Default: printf ("beyond"); Break;

}

}

Printf ("thank you \ n");

Returns 0;

}

I hope it helps you. :)