/**
求一个矩形被另一个矩形覆盖后,剩余部分至少能切成几个矩形。
这题1A,立即有一种极品屌丝的赶脚,直接if每一种情况
*/
#include <stdio.h>
#include <string.h>
void solve()
{
int ax,ay,bx,by,cx,cy,dx,dy;
scanf("%d%d%d%d%d%d%d%d",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy);
if(cx < ax)
cx = ax;
if(dx > bx)
dx = bx;
if(cy < ay)
cy = ay;
if(dy > by)
dy = by;
if(cy >= by || dy <= ay || cx >= bx || dx <= ax)
{
printf("1\n%d %d %d %d\n",ax,ay,bx,by);
return ;
}
if(cx <= ax && dx >= bx && cy <= ay && dy >= by)
{
printf("0\n");
ret
hnu 12432 Bottom of the sea#矩形交
最新推荐文章于 2012-08-24 00:14:27 发布