#include <stdio.h>int main(void){ float score; //score分數(shù) printf("請輸入您的考試成績:\n"); scanf("%f, &score"); if(score > 100 ) printf("這是做夢!\n"); else if (score>=90 && score<=100) //不能寫成90<=score<=100 ? ? &&是并且的意思 printf("優(yōu)秀!\n"); else if (score>=80 && score<90) printf("良好!\n"); else if (score>=60 && score<80) printf("及格!\n"); else if (score>=0 && score<60) printf("不及格!繼續(xù)努力!\n"); else printf("您輸入的分數(shù)過低,不要如此自卑!\n"); system("pause"); return 0;}//為什么我運行的時候運行的不對啊??? 不管填什么數(shù)字,最后都是顯示不及格!繼續(xù)努力
1 回答
已采納

onemoo
TA貢獻883條經(jīng)驗 獲得超454個贊
錯在?scanf("%f, &score"); 這里。
我覺得這只是你的筆誤,你應該是知道正確的寫法的:scanf("%f", &score);
- 1 回答
- 0 關注
- 1553 瀏覽
添加回答
舉報
0/150
提交
取消