文章目录 1. 结构体重载 在日常排序中 我们通常需要写 cmp + sort 来进行对结构体 等的排序 但是如果使用< >重载 也可以达到同样的效果 1. 结构体重载 struct three { int x; double y; string z; //重载 < 号 main 中可以直接调用sort函数进行排序 bool operator < (const three & t) const { return x < t.x; } }a[10010]; 配套例题