fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. vector<pair<int,pair<int,int> >> v;
  6. v.push_back(make_pair(2,make_pair(0,0)));
  7. v.push_back(make_pair(1,make_pair(1,1)));
  8. v.push_back(make_pair(3,make_pair(2,2)));
  9.  
  10. sort(v.begin(),v.end());
  11.  
  12. cout<<v[0].first<<endl;
  13. cout<<v[1].first<<endl;
  14. cout<<v[2].first<<endl;
  15.  
  16. cout<<v[0].second.first<<" "<<v[0].second.second<<endl;
  17. cout<<v[1].second.first<<" "<<v[1].second.second<<endl;
  18. cout<<v[2].second.first<<" "<<v[2].second.second<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 4180KB
stdin
Standard input is empty
stdout
1
2
3
1 1
0 0
2 2