Weight-bearing structure struct operator

struct node{
    int x,y,z;
}; 
bool operator<(node a,node b)
{
    if(a.x!=b.x) return a.x<b.x;
    if(a.y!=b.y) return a.y<b.y;
    return a.z<b.z;
}

Guess you like

Origin www.cnblogs.com/akioi/p/12200049.html