POJ 2388 Who's in the Middle(水题)

版权声明:听说这里让写版权声明~~~ https://blog.csdn.net/m0_37691414/article/details/82115088
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<int> v;
int main(){
	int n;
	cin >> n;
	v.resize(n);
	for(int i = 0; i < n; ++i)
		cin >> v[i];
	sort(v.begin(), v.end());
	cout << v[(n - 1)/2] << endl;
	return 0;
}

猜你喜欢

转载自blog.csdn.net/m0_37691414/article/details/82115088
今日推荐