黑马程序员技术交流社区
标题: 输入四个分数,打印出最高分和最低分 [打印本页]
作者: 403295277 时间: 2015-8-30 20:41
标题: 输入四个分数,打印出最高分和最低分
#include <stdio.h>
int main()
{
int _score1=0;
int _score2=0;
int _score3=0;
int _score4=0;
int _maxScore=0;
int _minScore=0;
printf("请输入学生的成绩,以‘,’分开\n");
scanf("%d,%d,%d,%d",&_score1,&_score2,&_score3,&_score4);
_maxScore=_score1;
_minScore=_score1;
if (_score2>_score1) {
_maxScore=_score2;
}else{
_minScore=_score2;
}
if(_score3>_score1){
_maxScore=_score3;
}else{
_minScore=_score3;
}
if(_score4>_score1){
_maxScore=_score4;
}else{
_minScore=_score4;
}
printf("最高分是:%d\n",_maxScore);
printf("最低分是:%d",_minScore);
return 0;
}
作者: 403295277 时间: 2015-8-30 20:42
选中才能看见代码 这是什么情况
作者: smilejoke 时间: 2015-8-30 20:52
。。。。。什么都看不见
作者: 403295277 时间: 2015-8-30 20:56
复制出了问题 选中{:2_31:}
作者: 403295277 时间: 2015-8-30 20:57
选中,要选中,不知道什么情况,知道的求解释
作者: 范文鹏 时间: 2015-8-31 21:24
建议你在楼下再发一次代码吧 要不看着太费劲了
作者: TTsu 时间: 2015-8-31 21:34
看你的代码还得要command+A呢
作者: 403295277 时间: 2015-8-31 21:36
代码有问题,发错了
作者: huahaoL 时间: 2015-8-31 22:16
字体颜色你设置的 是 白色 ?
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) |
黑马程序员IT技术论坛 X3.2 |