為什么 運(yùn)行錯(cuò)誤
#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)
應(yīng)該這樣寫,需要嚴(yán)格的范圍
2018-09-09
樓上這種是沒有必要的,因?yàn)樯弦患?jí)if已經(jīng)排除了score<10000,這一級(jí)else if再寫就是多余了,你的錯(cuò)誤在白金玩家下一條的"socre",你看看是不是打錯(cuò)了