各位帮我看看哪出问题了

img

img

不要用switch,要改成
if (){

}else if (){

}else{

}

case 后面只能是整形的常量,不能这样写代码哦,改为if语句,参考:

若成绩在65~74分,输出“D”;
若成绩在65分以下,输出“E”。
*/
int main(){
    int score;    
    scanf("%d",&score);
    if(score>=95){
        printf("A\n");    
    }else if(score>=85 && score<=94){
        printf("B\n");
    }else if(score>=75 && score<=84){
        printf("C\n");
    }else if(score>=65 && score<=74){
        printf("D\n");
    }else{
        printf("E\n");
    }    
}

你的问题在于,case中只能是常量,不能是表达式。
计算在switch上面计算,将计算结果传到switch中。