链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1029
//水题
//由于为奇数个,故排序后中间那个一定是所求
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
int *k;
int i;
while (cin >> n) {
k = (int *)malloc(sizeof(int)*n);
for (i = 0; i < n; i++) {
cin >> k[i];
}
sort(k, k+n);
cout << k[n/2] << endl;
}
return 0;
}