#include<stdio.h>
int main()
{
int score;
scanf_s("%d", &score);
char grade;
grade = score >= 90 ? 'A' : (score> 60 ? 'B' : 'C');
printf("%c", grade);
return 0;
}
C语言经典100例(15)条件运算符嵌套
最新推荐文章于 2024-09-01 22:08:18 发布
#include<stdio.h>
int main()
{
int score;
scanf_s("%d", &score);
char grade;
grade = score >= 90 ? 'A' : (score> 60 ? 'B' : 'C');
printf("%c", grade);
return 0;
}