[圖解C] ex 5-4(2)

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char grade;
   
    puts("enter the grade (A, B, C, D, E): ");
    scanf("%c", &grade);

    if (grade == 'A' || grade == 'a')
       printf("The grade is A.\n");
    else if (grade == 'B' || grade == 'b')
       printf("The grade is B.\n");
    else if (grade == 'C' || grade == 'c')
       printf("The grade is C.\n");
    else if (grade == 'D' || grade == 'd')
       printf("The grade is D.\n");
    else if (grade == 'E' || grade == 'e')
       printf("The grade is E.\n");
    else
       printf("No classification.\n");

    system("pause");
    return 0;
}