CF1760A.Medium Number

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Given three distinct integers aa, bb, and cc, find the medium number between all of them.

The medium number is the number that is neither the minimum nor the maximum of the given three numbers.

For example, the median of 5,2,65,2,6 is 55, since the minimum is 22 and the maximum is 66.

给定三个互不相同的整数 aa、bb 和 cc,求它们的中位数。

中位数是指这三个数中既不是最小值也不是最大值的那个数。

例如,5,2,65,2,6 的中位数是 55,因为最小值是 22,最大值是 66。

输入格式

The first line contains a single integer tt (1≤t≤68401 \leq t \leq 6840) — the number of test cases.

The description of each test case consists of three distinct integers aa, bb, cc (1≤a,b,c≤201 \leq a, b, c \leq 20).

第一行包含一个整数 tt(1≤t≤68401 \leq t \leq 6840)—— 表示测试用例的数量。

每个测试用例的描述由三个互不相同的整数 aa、bb、cc 组成(1≤a,b,c≤201 \leq a, b, c \leq 20)。

输出格式

For each test case, output a single integer — the medium number of the three numbers.

对于每个测试用例,输出一个整数——三个数的中位数。

输入输出样例

  • 输入#1

    9
    5 2 6
    14 3 4
    20 2 1
    1 2 3
    11 19 12
    10 8 20
    6 20 3
    4 1 3
    19 8 4

    输出#1

    5
    4
    2
    2
    12
    10
    6
    3
    8

输入解题思路,AI测评打分。不知道怎么写?

首页