在下面程序的横线处填上适当字句,完成类的定义。
class line;
class box
{
private:
int color;
int upx, upy;
int lowx, lowy;
pubnic:
_________void set_color (int c )
{
color =c;
}void define_box(int x1, int y1, int x2, int y2)
{ upx=x1; upy =y1; lowx =x2; lowy =y2; }
};
class line
{
private:
int color;
int startx, starty;
int endx, endy;
public:
friend int same_color(line l, box b)
void set_color (int c) { color =c; }
void define_line(_________)
{ startx =x1; starty =y1; endx =x2; endy =y2; }
};
int same_color (line l, box b)
{
if (l. color==b. color) return l;
retum 0;
}