blade


私信TA

用户名:blade

访问量:16473

签 名:

等  级
排  名 1815
经  验 2484
参赛次数 0
文章发表 11
年  龄 0
在职情况 学生
学  校 开侨
专  业

  自我简介:

解题思路:
最容易找出的就是最小值个最大值,然后再对比找出中间值

参考代码:

int  max, min, a, b, c, t;
	scanf("%d%d%d", &a, &b, &c);
	max = (a>b ? a : b)>c ? (a>b ? a : b) : c;
	min = (a<b ? a : b)<c ? (a<b ? a : b) : c;
	if (a>min&&a<max) { t = a; }
	else if (b>min&&b<max) { t = b; }
	else t = c;
	printf("%d %d %d", min, t, max);


 

0.0分

2 人评分

  评论区