Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int score;
- scanf("%d", &score);
- /*
- (X) 90 <= score <= 100
- score = 95: 90 <= 95 <= 100
- => 1 <= 100
- => 1
- score = 89: 90 <= 89 <= 100
- => 0 <= 100
- => 1
- */
- if( (score >= 90) && (score <= 100) ){
- printf("A+");
- }
- else if( score >= 85 && score <= 89 ){
- printf("A");
- }
- else if( score >= 80 && score <= 84 ){
- printf("A-");
- }
- // ........
- /*
- =: score = 100 => 100
- ==: score == 100 => 等於 : 1
- 不等於 : 0
- */
- else if( score == 0 ){
- printf("X");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement