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

为啥无法输出白金啊~

#include <stdio.h>

int main() 

{

    int score = 7200;

    //完善一下代码

    

    {

        if(score >=10000)

        printf("%s\n","钻石玩家");

    }

        

    

    {

        else if (score >=5000 )

        printf("%s\n","白金玩家");    

    }

    

    {

        else if (score>= 1000)

        printf("%s\n","青铜玩家");     

    }

  

    {

        else

        printf("%s\n","普通玩家");    

    }

    return 0;

}


提问者:我良辰必有重谢 2015-09-28 07:25

个回答

  • Neo47
    2015-10-24 18:12:36

    知道问题出在哪里了

    末尾才用else而不是用多个else

  • Neo47
    2015-10-23 21:31:59

    我的也输不出答案

  • Neo47
    2015-10-23 21:31:20

    #include <stdio.h>

    int main() 

    {

        int score = 7200;

        //完善一下代码

        if(score>=10000)

        { 

            printf("%s\n","钻石玩家");

        }

        else if(score >= 5000)

        { 

            printf("%s\n","白金玩家");

        }  

        else(score >= 1000)

        { 

            printf("%s\n","青铜玩家");

        }     

        else

        { 

            printf("%s\n","普通玩家");

        }    

        return 0;

    }


  • 全淅亚_01
    2015-10-18 13:39:26

    if(score >= 10000)

        {

            printf("钻石玩家");

        }

        else if(score >= 5000 )

        {

            printf("白金玩家");    

        }

    你格式错了if在括号外面

  • qq_追梦_26
    2015-09-28 08:53:51

    先把格式写正确。。。。。。