解法一、函式庫
✅ 完整代碼
評分結果(參考) : AC (3ms, 336KB)
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    
    vector<pair<int, int>> arr(n);
    for(auto& a : arr) cin >> a.first >> a.second;
    sort(arr.begin(), arr.end());
    for(auto& a : arr) cout << a.first << " " << a.second << "\n";
    
    return 0;
}