#include<iostream>
using namespace std;
class complex
{
private:
double real;
double imag;
public:
complex(double r=0,double i=0):real(r),imag(i){}
complex operator + (complex &c)
{return complex(c.real+real,c.imag+imag);}
complex operator - (complex &c)
{return complex(real-c.real,imag-c.imag);}
void display()
{
cout<<"该复数为"<<imag<<"i+"<<real<<endl;
}
};
int main()
{
complex a(1,2);
complex b(2,3),c(0,0);
a.display();
c=a-b;
c.display();
return 0;
}