#include<iostream>
using namespace std;
class Complex
{
double real, imag;
public:
Complex(double r = 0, double i = 0) :real(r), imag(i) {}
Complex operator+(double r);
friend Complex operator + (double r, const Complex& c);
double getVarReal()
{
return real;
}
double getVarImag()
{
return imag;
}
};
Complex Complex:: operator+(double r)
{
return Complex(real + r, imag);
}
Complex operator+(double r, const Complex& c)
{
return Complex(c.real + r, c.imag);
}
int main()
{
Complex n1;
cout << (5+n1).getVarReal() << endl;
n1 = n1 + 5;
cout << (n1+5).getVarReal() << endl;
}