问题描述
- 代码分行有问题,粘贴出来好乱
- #include#includeusing namespace std;class Complex{ public: Complex(double newx=0.0 double newy=0.0 ); //Complex(); Complex(Complex &c); double getx() const; double gety() const; Complex Add(const Complex &another); void Output(); friend istream & operator>>(istream &in const Complex &c); friend ostream & operator<<(ostream &out const Complex &c); Complex operator+(const Complex &c2)const; ~Complex(){}; private: double xy;};Complex::Complex(double newx double newy){ x=newx; y=newy;}/*Complex::Complex(){ x=0; y=0;}*/Complex::Complex(Complex &c){ x=c.x; y=c.y;}double Complex::getx()const{ return x;}double Complex::gety()const{ return y;}Complex Complex::Add(const Complex &another){ Complex r; r.x=x+another.getx(); r.y=y+another.gety(); return r;}void Complex::Output(){ cout<=0) cout<<""+""; cout<>(istream &in const Complex &c){// in>>""("">>c.x>>""<>c.x; in>>c.y; return in;}ostream & operator<<(ostream &out const Complex &c){ out<<""(""<>z1; cin>>z2; z4=z1.Add(z2); z4.Output(); z3 = z1+z2; z3.Output(); return 0;}
解决方案
python读取文件处理网页粘贴代码出现的问题
word中粘贴代码的排版问题
解决方案二:
然后lz想说明的什么
时间: 2024-10-31 05:26:12