#include
using namespace std;
//added your code here
Int main ()
{
Double Real, Imag;
cin> Real> Imag;
Const CComplex num1 (Real, Imag);
Cout<'(' & lt;
}
CodePudding user response:
Teachers teach all finished forget, can't remember the plural used to do,CodePudding user response:
Like this:
#include
using namespace std;
//added your code here
The class CComplex {
Double Real;
Double Imag;
Public:
CComplex (double R, double I) {
Real=R;
Imag=I;
}
Double GetRealNum () const {
Return Real;
}
Double GetImagNum () const {
Return Imag;
}
};
Int main ()
{
Double Real, Imag;
Cin & gt;> Real & gt;> Imag;
Const CComplex num1 (Real, Imag);
Cout & lt; <'(' & lt;return 0;
}
CodePudding user response:
There's a better way, by overloading the plural computing,