作业帮 > 综合 > 作业

二级C++下列程序中有三个错误,使程序的输出结果为The point is(0,1) The point is(3,5)

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 20:06:49
二级C++下列程序中有三个错误,使程序的输出结果为The point is(0,1) The point is(3,5)
#include
class Point{
public:
Point(int xx=0,int yy):x(xx),y(yy){}
void Move(int xOff,int yOff) const{
x+=xOff;y+=yOff;
}
void Print() const
{cout
Point(int xx=0,int yy=1):x(xx),y(yy){} // 要求默认值 (0,1) 所以 yy=1.
void Move(int xOff,int yOff) // 不能是 const
{ x+=xOff;y+=yOff; }
void Print() const
{cout