• 2023-05-262023.5.26编程一小时打卡
    一、问题描述:定义复数类MyComplex,主函数完成相关测试。MyComplex类结构说明:1、数据成员包括:私有数据成员:实部x(double)虚部y(double)。2、成员函数包括:无参构造函数MyComplex(void),其功能是将数据成员数部和虚部的值均设为0;有参构造函数MyComplex(doublevalue1,doublevalue2),其功能
  • 2022-11-26运算符重载 + -
    #include<iostream>usingnamespacestd;classmyComplex{private: doublereal,imag;public: myComplex(); myComplex(doubler,doublei); voidoutCom(); myComplexope
  • 2022-11-26c++友元类
    #include<iostream>usingnamespacestd;classmyComplex//复数类{private: doublereal,imag;public: myComplex(); myComplex(doubler,doublei); friendclassoper;
  • 2022-11-19运算符重载 + -
    #include<iostream>usingnamespacestd;classmyComplex{private: doublereal,imag;public: myComplex(); myComplex(doubler,doublei); voidoutCom(); myComplexo
  • 2022-11-19c++友元类
    #include<iostream>usingnamespacestd;classmyComplex//复数类{private: doublereal,imag;public: myComplex(); myComplex(doubler,doublei); friendclassope