练习专区

今天的一小步就是明天的一大步
Problem 1778 中位数
Accepted: 8   Total Submit: 12
Time Limit: 1000ms   Memory Limit: 30720KB
Description
如果是奇数个数,中位数就是排序后落在中间的数,如1 2 3 4 5,中位数是3;如果是偶数个数,中位数就是排序后落在中间的两个数,如1 2 3 4 ,中位数是2和3。现在请你编程求n个数的中位数。1 Input
先输入一个T表示有若T种案例(T<100)。每种案例的第一行先输入一个正整数m,表示有m个数据,接着有m个数据1<= m <100 。
Output
对每个案例先输出“Case id:”,接着输出中位数。格式见样例。
Sample Input
3
1
4
6
1 2 3 4 5 6
5
3 3 3 3 3
Sample Output
Case 1:4
Case 2:3,4
Case 3:3
Hint
提交     返回