switch
怎么做啊这题,谢谢了
#include <stdio.h> int main() { int score = 101; //考试分数为87分 if(score<=100&&score>=0){ switch(score/10) { case 10: case 9: printf("等级A"); break; case 8: printf("等级B"); break; case 7: case 6: printf("等级C"); break; default: printf("等级D"); break; } } else { printf("成绩出错(0~100):%d",score); } return 0; }
参考参考
举报