问答详情
源自:4-3 分支结构之多重if-else语句

为什么错了?

#include <stdio.h>
int main()
{
    int score = 7200;
    //完善一下代码
      {
        if(score>=10000)
        printf("钻石玩家");
    }
   
    {else if(score>=5000&&score<10000)
        printf("白金玩家");   
    }
   
    {else if(score>=1000&&score<5000)
        printf("青铜玩家");    
    }
 
    {else(score<1000)
        printf("普通玩家");   
    }
    return 0;
}

提问者:C_Bridge 2019-09-27 23:52

个回答

  • qq_IT_
    2019-09-29 17:21:25
    已采纳

    {}的位置错了   {}应该在if后面 而不是把if语句括起来了