作业帮 > 综合 > 作业

判断矩形相交程序为何错误?

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/06/16 03:25:45
判断矩形相交程序为何错误?
struct Rect{
Rect(int xV,int yV,int wV,int hV):x(xV),y(yV),w(wV),h(hV){}
int x;
int y;
int w;
int h;
};
bool (*CompareP) (int x,int y,Rect r2);
bool CompareV(int x,int y,Rect r2)
{
if(x>r2.x&&x=r2.y&&y
判断矩形相交程序为何错误?
已改,看注释
struct Rect
{
Rect(int xV,int yV,int wV,int hV):x(xV),y(yV),w(wV),h(hV){}
int x;
int y;
int w;
int h;
};
bool (*CompareP) (int x,int y,Rect r2);
bool CompareV(int x,int y,Rect r2)
{
if(x>=r2.x&&x=r2.y&&y