题目地址:
http://acm.hdu.edu.cn/showproblem.php?pid=1157
5482827 | 2012-03-06 18:16:49 | Accepted | 1157 | 0MS | 384K | 330 B | C++ | ajioy |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n,tmp;
vector<int> v;
while(cin >> n){
int len = n / 2;
while(n--){
cin >> tmp;
v.push_back(tmp);
}
sort(v.begin(),v.end());
cout << v[len] << endl;
v.clear();
}
}