题目内容:
在下划线处填上缺少的部分。 #include
#include
using namespace std;
class complex
{
public:
int real;
int imag;
complex(int r=0,int i=0)
{
real=r;
imag=i;
}
};
complex operator+( _________,complex& b)
{
int r=a.real+b.real;
int i=a.imag+b.imag;
return complex(r,i);
}
void main( )
{
complex x(1,2),y(3,4),z;
z=x+y;
cout<<><><><><>< p="">
}
参考答案: