Request according to test grade grade output percentile score section,a and so on above,B and so on 70~84 points, C and other for 60~69 ,D and so on for the following points. The grade of the grade is entered by the keyboard.
Solution: Program:
#include <stdio.h>
int main ()
{
char grade;
printf ("Please enter a grade:");
scanf ("%c", &grade);
printf ("Your score segment is:");
Switch (grade)
{
Case ' A ':p rintf ("85~100\n");
Break
Case ' B ':p rintf ("70~84\n");
Break
Case ' C ':p rintf ("60~69\n");
Break
Case ' D ':p rintf ("<60\n");
Break
default:printf ("Input grade level is wrong!") \ n ");
Break
}
return 0;
}
Results:
Please enter a grade:a
Your score segment is:85~100
Please press any key to continue ...
This article is from the "Rock Owl" blog, please be sure to keep this source http://yaoyaolx.blog.51cto.com/10732111/1741407
C Language: Required to follow the test results of the level output percentile score section, the grade of grades by the keyboard input.