#includeusing namespace std;class square{ public: square(int x1,int y1); //x1,x2为自定义长宽 int getchang() { return x;} //用于输出长 int getkuan() { return y;} //输出宽 int getmianji() { return z;}//输出面积 private: int x; int y; int z; };square::square(int x1,int y1) { x=x1;y=y1;z=(x*y); //使用输入的自定义值赋值 }int main(){ int e,f; cout<<"请输入自定义长方形的长与宽:"; cin>>e>>f; square a1(e,f); cout<<"自定义长,宽为:"< <<","< <
#includeusing namespace std;class Complex{ public: Complex(double r0,double i0); Complex(double r0); Complex(const Complex &c); ~Complex(){} void add(Complex &c0); void show(){cout< <<'+'< <<'i'<