黑马程序员技术交流社区
标题:
大师说的对,我也来当回屌丝
[打印本页]
作者:
丶浩浩丶
时间:
2015-4-12 00:25
标题:
大师说的对,我也来当回屌丝
printf("输出4科成绩数,以逗号分\n");
int score1,score2,score3,score4;
score1 =score2 =score3 =score4 =0;
scanf("%d,%d,%d,%d",&score1,&score2,&score3,&score4);
int MaxScore,MinScore;
MaxScore=MinScore=0;
MaxScore = ((score1>score2 ? score1:score2)>score3 ? (score1>score2 ? score1:score2) :score3)>score4 ? ((score1> score2 ? score1:score2)>score3 ? (score1>score2 ? score1:score2) :score3) :score4;
MinScore = score1<score2 ? score1:score2<score3 ? score1<score2 ? score1:score2 :score3<score4 ? score1<score2 ? score1:score2<score3 ? score1<score2 ? score1:score2 :score3 :score4;
printf("最高分是%d,最低分是%d\n",MaxScore,MinScore);
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2