• 2022-07-22 问题

    对于以下的变量定义,表达式______是不正确的。struct { float x, y;} point, *p=&point; A: p->x=2.0 B: (*p).y=3.0 C: point.x=2.0 D: *p->y=3.0

    对于以下的变量定义,表达式______是不正确的。struct { float x, y;} point, *p=&point; A: p->x=2.0 B: (*p).y=3.0 C: point.x=2.0 D: *p->y=3.0

  • 2022-06-15 问题

    有以下说明语句:structpoint{intx;inty;}p;则正确的赋值语句是() A: point.x=1;point.y=2; B: point={1,2}; C: p.x=1;p.y=2; D: p={1,2};

    有以下说明语句:structpoint{intx;inty;}p;则正确的赋值语句是() A: point.x=1;point.y=2; B: point={1,2}; C: p.x=1;p.y=2; D: p={1,2};

  • 2022-06-08 问题

    下面定义结构体数组的代码段正确的是()。 A: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT[] p;p=new POINT[100]; B: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p[100]; C: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p[]=new POINT[100]; D: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p=new POINT[100];

    下面定义结构体数组的代码段正确的是()。 A: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT[] p;p=new POINT[100]; B: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p[100]; C: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p[]=new POINT[100]; D: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p=new POINT[100];

  • 2022-06-27 问题

    变量x的值为5,x的地址为3000,若欲使point为指向x的指针变量,则下列赋值正确的是( )。 A: &x=5 B: *point=5 C: *point=3000 D: point=&x

    变量x的值为5,x的地址为3000,若欲使point为指向x的指针变量,则下列赋值正确的是( )。 A: &x=5 B: *point=5 C: *point=3000 D: point=&x

  • 2022-06-07 问题

    已知:Point x(3,4); 则下列声明中能定义p指针变量并使其初值指向x的是( ) 。 A: int &p=x; B: Point *p=&x; C: Point p=x; D: float *p=&x;

    已知:Point x(3,4); 则下列声明中能定义p指针变量并使其初值指向x的是( ) 。 A: int &p=x; B: Point *p=&x; C: Point p=x; D: float *p=&x;

  • 2022-06-08 问题

    下列代码中: class Point{ int x,y; public: Point(int a, int b=0); //① Point(Point &aPoint); //②Point(Point *p); //③ 默认的构造函数是 A: ① B: ② C: ③ D: 没有

    下列代码中: class Point{ int x,y; public: Point(int a, int b=0); //① Point(Point &aPoint); //②Point(Point *p); //③ 默认的构造函数是 A: ① B: ② C: ③ D: 没有

  • 2021-04-14 问题

    If X and Y are measured in the same units and we consider a point that lies below a 45° line, then we know that for the X and Y combination associated with this point, <p></p>

    If X and Y are measured in the same units and we consider a point that lies below a 45° line, then we know that for the X and Y combination associated with this point, <p></p>

  • 2022-07-22 问题

    下面为一个点类,重载了负号运算符,将原来点改为其关于原点的对称点。 请填空补充完整程序。 #include &#91;iostream.h&#93;[br][/br] class Point{ private: float x; float y; public: Point(){ x = 0; y = 0; } Point(float a, float b){ x = a; y = b; } // 显示坐标 void display() { cout << "X: " << x << " Y:" << y <<endl; } // 重载负运算符 -,取对称点 friend Point operator-(Point a) { Point r; (1) ; (2) ; return r; } }; void main() { Point p1(5, 6); ; // 取对称点 p1.display(); //p1中的x和y值分别为-5和-6 }

    下面为一个点类,重载了负号运算符,将原来点改为其关于原点的对称点。 请填空补充完整程序。 #include &#91;iostream.h&#93;[br][/br] class Point{ private: float x; float y; public: Point(){ x = 0; y = 0; } Point(float a, float b){ x = a; y = b; } // 显示坐标 void display() { cout << "X: " << x << " Y:" << y <<endl; } // 重载负运算符 -,取对称点 friend Point operator-(Point a) { Point r; (1) ; (2) ; return r; } }; void main() { Point p1(5, 6); ; // 取对称点 p1.display(); //p1中的x和y值分别为-5和-6 }

  • 2022-07-02 问题

    有如下类定义: class Point { int x_,y_; public: Point():x_(0),y_(0){ } Point(int x,int y=0):x_(x),y_(y){} }; 若执行语句 Point a(2),b&#91;3&#93;,*c&#91;4&#93;; 则Point类的构造函数被调用的次数是

    有如下类定义: class Point { int x_,y_; public: Point():x_(0),y_(0){ } Point(int x,int y=0):x_(x),y_(y){} }; 若执行语句 Point a(2),b&#91;3&#93;,*c&#91;4&#93;; 则Point类的构造函数被调用的次数是

  • 2022-06-08 问题

    有如下类的定义[br][/br] public class Point { int x;[br][/br] int y;[br][/br] public void show(){ System.out.println("x="+x+",y="+y)[br][/br] }[br][/br] public Point(){[br][/br] }[br][/br] public Point(int x , int y){ this.x = x;[br][/br] this.y = y;[br][/br] }[br][/br] } Point p1 = new Point(); Point p2 = new Point(); Point p3 = new Point(1,1); 关于创建的对象说法不正确的是() A: p1==p2的值是true B: p1.show()的输出结果是x=0,y=0 C: p3.show()输出的结果是x=1,y=1 D: p1.x = 10,是将p1对象的x属性赋值为10,不能改变p2和p3对象的x属性值。

    有如下类的定义[br][/br] public class Point { int x;[br][/br] int y;[br][/br] public void show(){ System.out.println("x="+x+",y="+y)[br][/br] }[br][/br] public Point(){[br][/br] }[br][/br] public Point(int x , int y){ this.x = x;[br][/br] this.y = y;[br][/br] }[br][/br] } Point p1 = new Point(); Point p2 = new Point(); Point p3 = new Point(1,1); 关于创建的对象说法不正确的是() A: p1==p2的值是true B: p1.show()的输出结果是x=0,y=0 C: p3.show()输出的结果是x=1,y=1 D: p1.x = 10,是将p1对象的x属性赋值为10,不能改变p2和p3对象的x属性值。

  • 1 2 3 4 5 6 7 8 9 10