image.png
    image.png

    1. // 下面这段代码,看起来很奇怪,可是一定要很熟悉的啊
    2. #include <bits/stdc++.h>
    3. using namespace std;
    4. struct node{
    5. int x, y;
    6. node(int _x = 0, int _y = 0): x(_x), y(_y){}
    7. bool operator< (const node& W)const{
    8. if (x == W.x) return y < W.y;
    9. return x < W.x;
    10. }
    11. };
    12. int main(){
    13. node A = node(2, 3);
    14. node B = node(3, 4);
    15. if (A < B) cout << '<' << '\n';
    16. else cout << ">=" << '\n';
    17. return 0;
    18. }