為什么我跑出來的是白金玩家普通玩家??!
#include <stdio.h>
int main()
{
int score = 7200;
if (score >= 10000)
{
printf("鉆石玩家\n");
}
else if (score >= 5000)
{
printf("白金玩家\n");
}
else if (score >= 1000)
{
printf("青銅玩家\n");
}
else (score < 1000);
{
printf("普通玩家\n");
}
return 0;
}
2020-07-06
2020-06-28
六樓正解,else后內容刪掉
2020-06-16
條件中包含并且,所以第一個 else if應該是else if(5000<=score<10000) 以此類推
2020-06-16
if后面寫條件表達式,else后面不可以寫條件表達式
2020-06-09
?if(score>=10000)
??? {
??????? printf("鉆石玩家");
??? }
??? else if(10000>score&&score>=5000)
??? {
??????? printf("白金玩家");???
??? }
??? else if(score>=1000&&score<5000)
??? {
??????? printf("青銅玩家");????
??? }
??? else if(score<1000)
??? {
??????? printf("普通玩家");???
??? }
2020-06-08
#include <stdio.h>
int main()?
{
? ? int score = 7200;
? ? if(score>=10000)//完善一下代碼
? ??
? ? {
? ? ? ? printf("鉆石玩家");
? ? }
? ? else if(score>=5000)
? ? {
? ? ? ? printf("白金玩家");? ??
? ? }
? ? else if(score>=1000)
? ? {
? ? ? ? printf("青銅玩家");? ? ?
? ? }
? ? else
? ? {
? ? ? ? printf("普通玩家");? ??
? ? }
? ? return 0;
}
2020-05-25
else多寫了個分號嗎
2020-05-25
你沒限制他的上限 大于等于5000并且小于10000