1.题面
http://poj.org/problem?id=3481
2.解题思路
排序后求中位数,表示解题代码还没我的头文件长
3.解题代码
/*****************************************************************
> File Name: tmp.cpp
> Author: Uncle_Sugar
> Mail: uncle_sugar@qq.com
> Created Time: 2016年02月18日 星期四 12时44分45秒
****************************************************************/
# include <cstdio>
# include <cstring>
# include <cmath>
# include <cstdlib>
# include <iostream>
# include <iomanip>
# include <set>
# include <map>
# include <vector>
# include <stack>
# include <algorithm>
using namespace std;
const int debug = 1;
const int size = 10000 + 10;
typedef long long ll;
int cow[size];
int main()
{
int i,j,k;
int n;
while (cin >> n){
for (i=0;i<n;i++)
cin >> cow[i];
sort(cow,cow+n);
cout << cow[(n-1)/2] << '\n';
}
return 0;
}