為什么 運行錯誤
#include <stdio.h>
int main()
{
??? int score = 7200;
??? //完善一下代碼
??? if(score>=10000)
??? {
??????? printf("鉆石玩家");
??? }
??????? else if (score>=5000)
??? {
??????? printf("白金玩家");???
??? }
??????? else if (socre>=1000)
??? {
??????? printf("青銅玩家");???
??? }
??????? else
??? {
??????? printf("普通玩家");???
??? }
??? return 0;
}
2018-09-09
else if(score<10000 && score>=5000)
應該這樣寫,需要嚴格的范圍
2018-09-09
樓上這種是沒有必要的,因為上一級if已經排除了score<10000,這一級else if再寫就是多余了,你的錯誤在白金玩家下一條的"socre",你看看是不是打錯了