判断矩形相交程序为何错误?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

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 10:14:46

判断矩形相交程序为何错误?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

判断矩形相交程序为何错误?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