32 lines
541 B
C
32 lines
541 B
C
#include <stdio.h>
|
|
|
|
void get_score(int s);
|
|
|
|
int main(void) {
|
|
// Initialize variables and get input from stdin
|
|
int score;
|
|
scanf("%d", &score);
|
|
|
|
get_score(score);
|
|
|
|
return 0;
|
|
}
|
|
|
|
void get_score(int s) {
|
|
if (s > 100) {
|
|
printf("The score is out of range!\n");
|
|
} else if (s >= 90) {
|
|
printf("A\n");
|
|
} else if (s >= 80) {
|
|
printf("B\n");
|
|
} else if (s >= 70) {
|
|
printf("C\n");
|
|
} else if (s >= 60) {
|
|
printf("D\n");
|
|
} else if (s >= 0) {
|
|
printf("E\n");
|
|
} else {
|
|
printf("The score is out of range!\n");
|
|
}
|
|
}
|