c++(短代码)
#include <iostream>
#include <algorithm>
using namespace std;
int n, a;
vector<pair<int, int>> s;
int main()
{
cin >> n;
while (cin >> n >> a) s.push_back({a, n});
stable_sort(s.begin(), s.end());
for (auto x : s) cout << x.second << ' ' << x.first << endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发