//Ex6_17.cpp
#include "iostream" 
using namespace std;
class Complex
{private:
	double m_image;   //描述实部
	double m_real;     //描述需部
 public:
	Complex (double i=0,double j=0)
		{m_real=i;m_image=j;}
	void show()
		{cout<<m_real<<"+"<<m_image<<"i"<<endl;}
    Complex operator +(Complex &p)
		{return Complex(m_real+p.m_real,m_image+p.m_image);}  
    Complex operator *(Complex &p)
		{double m_i,m_r;
         m_i= m_real*p.m_real-m_image*p.m_image;
         m_r= m_real*p.m_image+m_image*p.m_real;
         return Complex(m_i,m_r);}  
};
void main()
{Complex A(1,2),B(5,6),C;
 C=A+B;
 C.show();
 C=A*B;
 C.show();
}   
