#include <iostream>
using namespace std;
class Complex
{
public:
Complex(){real=0;imag=0;}
Complex(double r,double i){real=r;imag=i;}
Complex operator/(const Complex &c2);
void display();
private:
double real,imag;
};
Complex Complex::operator/(const Complex &c2)
{
return Complex(real/c2.real,imag/c2.imag);
}
void Complex::display()
{
if(imag<0){
cout<<real<<"i"<<imag<<endl;
}
else
{
cout<<real<<"i"<<"+"<<imag<<endl;
}
}
int main()
{
using namespace std;
class Complex
{
public:
Complex(){real=0;imag=0;}
Complex(double r,double i){real=r;imag=i;}
Complex operator/(const Complex &c2);
void display();
private:
double real,imag;
};
Complex Complex::operator/(const Complex &c2)
{
return Complex(real/c2.real,imag/c2.imag);
}
void Complex::display()
{
if(imag<0){
cout<<real<<"i"<<imag<<endl;
}
else
{
cout<<real<<"i"<<"+"<<imag<<endl;
}
}
int main()
{