#include <iostream>
using namespace std;
class complex{
int real, img;
public:
complex(int real, int img){
this->real=real;
this->img=img;
}
void display(){
cout<<"The real part is " <<real << endl;
cout<<"The imaginary part is " <<img << endl;
}
friend void operator -(complex&c);
};
void operator -(complex &c){
c.real=-c.real;
c.img=c.img;
}
int main(){
int a, b;
cout << "Enter real part: " << endl;
cin >> a;
cout <<"Enter imaginary part: " << endl;
cin >> b;
complex c1(a,b);
cout << "Real and imaginary before overloading: " << endl;
c1.display();
-c1;
cout << "Real and imaginary after overloading: " <<endl;
c1.display();
return 0;
}