定义格式 friend 类名 operator 运算符名称(形参表)
实现“+”和“-”
#include <iostream>
using namespace std;
class Complex
{
public:
Complex()
{
real = 0;
imag = 0;
}
Complex(double r, double i)
{
real = r;
imag = i;
}
friend Complex operator+(Complex &c1