You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
452 B
23 lines
452 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int n, p, q;
|
|
cin >> n;
|
|
vector<float> v1;
|
|
for (int i = 0; i < n; ++i) {
|
|
float f;
|
|
cin >> f;
|
|
v1.push_back(f);
|
|
}
|
|
cin >> p >> q;
|
|
//排序(升序)
|
|
sort(v1.begin(), v1.end(), less<float>());
|
|
//删除第p个数据
|
|
v1.erase(v1.begin() + p);
|
|
//输出第q个数据
|
|
cout << v1[q - 1] << endl;
|
|
return 0;
|
|
}
|