int main(){
int score;
printf("enter the score: ");
scanf("%d", &score);
printf("the grade is %c!\n", score >= 90 ? 'A' : (score >= 60 ? 'B' : 'C'));
return 0;
}
条件运算符的嵌套
最新推荐文章于 2022-02-25 09:04:00 发布
int main(){
int score;
printf("enter the score: ");
scanf("%d", &score);
printf("the grade is %c!\n", score >= 90 ? 'A' : (score >= 60 ? 'B' : 'C'));
return 0;
}