#include <stdio.h> #include <assert.h> int main() { char grade; int score; scanf("%d", &score) ; if((score>=90) && (score<=100)) { grade='a'; } else if((score>=80) && (score<90)) { grade='b'; } else if((score>=70) && (score<80)) { grade='c'; } else if((score>=60) && (score<70)) { grade='d' ; } else { grade='f'; } printf("%c \n", grade); //assert(grade=='c'); return 0;
#include <stdio.h> #include <assert.h> int main() { char grade; int score; scanf("%d", &score); if((100>=score) && (score>=90)){ grade='a'; } else if((90>score) && (score>=80)){ grade='b'; } else if((80>score) && (score>=70)){ grade='c'; } else if((70>score) && (score>=0)){ grade='d'; } else{grade='f';} printf("%c" , grade); //assert(grade=='c'); return 0; }