2016.11.21

来源:互联网 发布:轩辕剑美人进阶数据 编辑:程序博客网 时间:2024/05/04 13:46
typedef struct Time{    int hour, minute;    bool operator<(Time b)    {        if(hour == b.hour)            return minute < b.minute;        return hour < b.hour;    }    bool operator>=(Time b)    {        return !(*this < b);    }    bool operator<=(Time b)    {        return !(b < *this);    }    bool operator==(Time b)    {        return !(b < *this) && !(*this < b);    }} Time;typedef struct Flight{    string id, org, to;    Time beg, ed;    int price;} Flight;int cmp(Flight a, Flight b){    if(a.beg == b.beg){        if(a.price == b.price){            return a.id < b.id;        }        return a.price < b.price;    }    return a.beg < b.beg;}

以下代码

> >  if(a.beg == b.beg){>         if(a.price == b.price){>             return a.id < b.id;>         }>         return a.price < b.price;>     }>     return a.beg < b.beg;

不等于

 if(a.beg == b.beg){        if(a.price == b.price)            return a.id < b.id;        return a.price < b.price;    return a.beg < b.beg;}

嗯,一个月做一次题,
结果就是他妈的蠢到这份上

0 0
原创粉丝点击