结构体struct

来源:互联网 发布:猎场网络什么时候播出 编辑:程序博客网 时间:2024/06/14 09:11

‘<’的重定义

struct Project{    string name;    int cnt;}project[100];bool operator<(const Project &p1, const Project &p2){    if(p1.cnt==p2.cnt) return p1.name<p2.name;    return p1.cnt>p2.cnt;}

bool tmp(haha a,haha b){return a.e>b.e;}

0 1
原创粉丝点击