求两个复数的加减乘

2019-04-14 17:27发布

#include"iostream" #include"iomanip" using namespace std; class fushu { float x,y; public: fushu(float a=0,float b=0) { x=a; y=b; } void add(fushu &m,fushu &n) { x=m.x+n.x; y=m.y+n.y; disp(); } void chengfa(fushu &m,fushu &n) { x=m.x*n.x-m.y*n.y; y=m.x*n.y+n.y*n.x; disp(); } void disp() { cout<