How to write a C Program if in C Programming Language ?
Solution For C Program :
#include <stdio.h>
int main(){
int score;
scanf("%d", &score);
/*
if : (x) 0
(o) 1, -1, 2 .... NOT 0
*/
/*
(x) 90 <= score <= 100
score = 95:
90 <= score: 1
1 <= 100: 1
score = 80:
90 <= score: 0
0 <= 100: 1
*/
if( (90 <= score) && (score <= 100) ){
printf("A+");
}
else if( (85 <= score) && (score <= 89) ){
printf("A");
}
else if( (80 <= score) && (score <= 84) ){
printf("A-");
}
// ......
else if( (1 <= score) && (score <= 59) ){
printf("F");
}
else if( score == 0 ){
printf("X");
}
/*
== : 0 / 1
ex. a(3) a == 3; : 1
a(5) a == 3; : 0
= : 代入的值
ex. a(3) a = 3; : 3
a(5) a = 3; : 3
*/
return 0;
}