用if分段判判断就可以
#include<stdio.h> #include <math.h> void main() { int i,x; scanf("%d",&x); if(x>90) printf("a"); else if(x>=60&&x<90) printf("b"); else printf("c"); }