有下列程序:
#include<iostream>
using namespace std;
class Complex
double re,im;
public:
Complex(double r,double i):re(r),im(i)
double real( )constretum re;
double image( )constreturn im;
Complex& operator+=(Complex
题库:计算机等级考试
类型:最佳选择题
时间:2017-07-03 15:59:31
免费下载:《单选题》Word试卷
有下列程序:
#include<iostream>
using namespace std;
class Complex
double re,im;
public:
Complex(double r,double i):re(r),im(i)
double real( )constretum re;
double image( )constreturn im;
Complex& operator+=(Complex
A.
re+=a.re;
im+=a.im;
return*this;
;
ostream& operator<<(ostream& s,const Complex& z)
return s<<’(’<<z.real()《’,’<<Z.image0<<’)’;
int main()
Complex x(1,2),y(2,3);
cout<<(x+=y)<<endl;
return 0;
执行这个程序的输出结果是( )。A) (1,-2)
B.(2,3)
C.(3,5)
D.(3,1)
本题关键词:序列关系,空间序列,程序,内部空间序列,序列位置因素,自旋回波序列,病案排列顺序,高度重复序列,有序镜检,工程施工程序;