文章
19
粉丝
0
获赞
125
访问
2.9k
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
set<int> set;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
set.insert(x);
}
vector<int> a(set.begin(), set.end()); //复制set数据
sort(a.begin(), a.end());
int k;
cin >> k;
if (k >= 1 && k <= (int)a.size()) {
cout << a[k - 1] << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发