题目链接:http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1§ionid=3&problemid=21
方法:排序
思路:排序后选出中间值,简单题
难点:注意数组下标的对应关系
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int h[10000+10];
int n;
while(~scanf("%d",&n))
{
for(int i = 1; i <= n;i++)
scanf("%d",&h[i]);
sort(h+1,h+n+1);
printf("%d\n",h[n/2+1]);
}
}