格式:bool operator < (const node &temp)const{return ...;}
//应用样例
#include<bits/stdc++.h>
using namespace std;
struct node{
int a,b;
bool operator < (const node &c)const{
if(a==c.a) return b<c.b;
else return a>c.a;
}
}t[10];
int main(){
t[0]={4,1},t[1]={6,2},t[2]={5,3},t[3]={7,4},t[4]={5,5};
sort(t,t+5);
for(int i=0;i<5;i++) cout<<t[i].a<<" "<<t[i].b<<endl;
return 0;
}
/*
输出:
7 4
6 2
5 3
5 5
4 1
*/