my code
2025-10-25 15:16:37
发布于:江苏
3阅读
0回复
0点赞
my code is:
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> d(n);
for (int i = 0; i < n; ++i) {
cin >> d[i];
}
sort(d.begin(), d.end());
int x = d.back();
int y = d[d.size() - 3];
cout << x << " " << y << endl;
return 0;
}
这里空空如也






有帮助,赞一个