| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2004 人关注过本帖
标题:[没人气,抄道题] 矩形面积
取消只看楼主 加入收藏
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册: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
快速回复:[没人气,抄道题] 矩形面积
数据加载中...
 
   



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

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