| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 502 人关注过本帖
标题:各位高手帮忙 输入分数 显示等级。
只看楼主 加入收藏
隐隐很作痛
Rank: 2
等 级:论坛游民
帖 子:24
专家分:15
注 册:2010-11-1
结帖率:75%
收藏
已结贴  问题点数:5 回复次数:3 
各位高手帮忙 输入分数 显示等级。
#include <stdio.h>
void main()
{
    int score;
    printf("please enter score\n",score);
    scanf("%d",&score);
    if(score>=90)            printf ("score is a%d\n",score);
    if(score>=80&&score<=89) printf ("score is b%d\n",score);
    if(score>=70&&score<=79) printf ("score is c%d\n",score);
    if(score>=60&&score<=69) printf ("score is d%d\n",score);
    if(score <60)            printf ("score is e%d\n",score);
}
搜索更多相关主题的帖子: 分数 等级 输入 
2010-11-01 22:50
qb3276
Rank: 2
等 级:论坛游民
帖 子:24
专家分:42
注 册:2010-10-25
收藏
得分:0 
后面的参数可以不用。改下:
#include <stdio.h>
void main()
{
    int score;
    printf("please enter score\n",score);
    scanf("%d",&score);
    if(score>=90)            printf ("score is a\n");
    if(score>=80&&score<=89) printf ("score is b\n",);
    if(score>=70&&score<=79) printf ("score is c\n");
    if(score>=60&&score<=69) printf ("score is d\n");
    if(score <60)            printf ("score is e\n");
}
2010-11-01 22:59
红色警戒
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:19
帖 子:444
专家分:2967
注 册:2005-11-20
收藏
得分:0 
需要帮什么忙

2010-11-01 23:37
freezesoul
Rank: 2
等 级:论坛游民
帖 子:47
专家分:38
注 册:2010-3-13
收藏
得分:5 
回复 2楼 qb3276
#include <stdio.h>
int main()
{
    int score;
    printf("please enter score\n");
    scanf("%d",&score);
    if(score<=60)                  printf ("score is E\n");
    else if(score<=70)             printf ("score is D\n");
    else if(score<=80)             printf ("score is C\n");
    else if(score<=90)             printf ("score is B\n");
    else if(score<=100)            printf ("score is A\n");
    getch();
}


[ 本帖最后由 freezesoul 于 2010-11-1 23:52 编辑 ]
2010-11-01 23:50
快速回复:各位高手帮忙 输入分数 显示等级。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012030 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved