有以下程序:
#include<iostream>
using namespace std;
class Complex
public:
Complex(dOuble r=0,dOuble i=0):re(r),im(i)
doublereal()constreturn re;
doubleimag()constreturn im;
Complex operator+(Complex c)const
return Complex(re+c.re,im+c.im);
private:
double re,im;
;
int main()
Complex a=Complex(1,1)+Complex(5);
cout<<a.real()<<‘+’<<a.imag()<<‘i’<<endl;
return 0;
程序执行后的输出结果是( )。
A) 6+6i
B) 6+1i
C) 1+6i
D) 1+1i