pair(typedef pair PII)

image.png

  1. pair<int, int> A, B;
  2. A = make_pair(1, 2); //比赛中可以用这种写法
  3. //经常的,会这样去用
  4. #include <bits/stdc++.h>
  5. using namespace std;
  6. typedef pair<int, int> PII;
  7. const int N = 110;
  8. PII a[N];
  9. int main()
  10. {
  11. int n;
  12. cin >> n;
  13. for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  14. return 0;
  15. }