求助运算符重载
  • 板块灌水区
  • 楼主0X0002M
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/8/30 22:05
  • 上次更新2023/11/3 00:16:01
查看原帖
求助运算符重载
943192
0X0002M楼主2023/8/30 22:05

这个结构体定义干了什么

 int h, j, m, w;
10
11 Node(const int _h, const int _j, const int _m, const int _w):
12 h(_h), j(_j), m(_m), w(_w)
13 { }
14
15 Node operator+(const Node &o) const
16 {
17 return Node(
18 max(h, w + o.h),
19 max(max(j, o.j), m + o.h),
20 max(m + o.w, o.m),
21 w + o.w);
22 }
23 };
2023/8/30 22:05
加载中...