为啥无法输出白金啊~

来源:4-3 分支结构之多重if-else语句

我良辰必有重谢

2015-09-28 07:25

#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;

}


写回答 关注

5回答

  • 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

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

C语言入门

C语言入门视频教程,带你进入编程世界的必修课-C语言

926901 学习 · 21532 问题

查看课程

相似问题