#include<iostream>
using namespace std;
class Complex {
private:
double real, imag;
public:
Complex(double r = 0.0, double i = 0.0) {
real = r;
imag = i;
}
Complex operator +(Complex c);
Complex operator -(Complex c);
void display();
};
Complex Complex ::operator +(Complex c) {
return Complex(real + c.real, imag + c.imag);
}
Complex Complex::operator -(Complex c) {
return Complex(real - c.real, imag - c.imag);
}
void Complex::display() {
cout << "(" << real << "," << imag << ")" << endl;
}
int main(){
Complex c1(7,8),c2(2,3),c3;
c3 = c1 + c2;
c3.display();
c3 = c1 - c2;
c3.display();
return 0;
}