Archive
代码说明:
4) 创建一个名为Complex的类,进行复数的算术运算。复数的形式为: realpart+imaginarypart*i 用浮点变量表示类的private数据。提供构造函数,能够对所声明的该类对象进行初始化。在不提供初始化值的情况下,该构造函数应包含默认值。针对以下功能,分别提供一个public成员函数。 (1)两个复数相加; (2)两个复数相减 (3)用(a, b)的形式打印复数,其中a为实部,b为虚部。 (4) Create a class called Complex, and perform complex arithmetic operations. Plural form: realpart+imaginarypart* i said private data class with floating point variables. Provide a constructor, the object can be declared for the class is initialized. In the case do not provide initialization values, the constructor should contain default values. For the following functions, which provide a public member function. (A) two complex numbers (2) the subtraction of two complex (3) (a, b) in the form of plural printing, where a is the real part, b is the imaginary part.)
下载说明:请别用迅雷下载,失败请重下,重下不扣分!