标题:[没人气,抄道题] 矩形面积
取消只看楼主
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:507
帖 子:8890
专家分:53117
注 册:2011-1-18
结帖率:91.67%
已结贴  问题点数:100 回复次数:0 
[没人气,抄道题] 矩形面积
Find the total area covered by two rectilinear rectangles in a 2D plane.
Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.
Assume that the total area is never beyond the maximum possible value of int.



求两个矩形组成的总面积,每个矩形给出了左下角坐标和右上角坐标。
如图,左边矩形的面积是 24,右边矩形的面积是 27,两矩形的交集面积是 6,所以总面积是 24+27-6=45

int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
    // 代码
}
搜索更多相关主题的帖子: possible beyond bottom 
2015-08-07 09:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-456171-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.381775 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved