初始化函数的简单写法

struct seg
{
    double l, r, h;
    int flag;
    seg() {}
    seg(double a,double b,double c,int d) : l(a), r(b), h(c), flag(d) {}
    bool operator < (const seg &cmp) const
    {
        return h < cmp.h;
    }
}ss[maxn];

  

posted @ 2018-12-15 18:58  Member  阅读(473)  评论(0编辑  收藏  举报