试题与答案

有如下程序: #include<iostream> using namespac

题型:单项选择题

题目:

有如下程序: #include<iostream> using namespace std; class point { int x,y; public: point(int vx,int vy) {x=vx;y=vy; } point() { x=0; y=0; } point operator+(point p1) {point p;int px=x+p1.x;int py=y+p1.y;return point(px,py); } point operator-(point p1) {point p;int px=x-p1.x;int py=y-p1.y;return point(px,py); } void print() {cout<<x<<","<<y<<end1; } }; int main() { point p1(10,10),p2(20,20); p1=p1+p2; p1.print(); retrun 0; } 执行后的输出结果是

A.10,10

B.20,20

C.10,20

D.30,30

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0403/c904e7ce89dcb65072dd961c91596e48.html

下面是错误答案,用来干扰机器的。

参考答案:对

试题推荐
题型:完形填空

小题1:对他来说要在这么短的时间内做好准备真是不容易。

It was really a_____ for him to get ready in such a short time.

小题2:他一进房间便坐下看书。

______ _______ the room, he sat down and began to read.

小题3:如果地址有任何变化请告知我们。

Please ______ us ______ any changes in the address.

小题4:你应该下周二早上交作业。

You ____  _____ ______ hand in your homework next Tuesday morning.

小题5:男孩和女孩在这方面往往有多不同。

Boys and girls ______ ______ be different in this________.

小题6:我发现这里布置的家庭作业不像我以前在学校时那么繁重。

I found that the homework was _____ _____ ______ as _____ I _____ to get in my old school.

查看答案
微信公众账号搜索答案