1.定义一个复数类Complex,该类有代表实部与虚部的成员变量,有两个构造函数Complex()
2016-08-23
0
0
0
暂无评分
其他
1
积分下载
如何获取积分?
1.定义一个复数类Complex,该类有代表实部与虚部的成员变量,有两个构造函数Complex()与Complex(int x,int y)分别完成将成员变量初始化为0及给定值,另有计算复数的加减法及输出复数的三个方法,编程序利用该类完成2+3i与6-8i相加,12+9i与20-8i相减,并利用复数的输出方法将结果输出。-Define a complex number class Complex, the class is represented real and imaginary parts of the member variable, there are two constructor Complex () and the Complex (int x, int y) of the respective member variables will be initialized to 0 and the given value Another calculation of complex addition and subtraction method and output the plural of the three methods, programmed to use the class to complete 2+3 i and 6-8i sum, 12+9 i and subtract 20-8i, and the use of the plural output method results output.