求c++复数计算器1)所设计的复数计算器可以进行+ - * += -= *= ++ -- >= =

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 11:17:35
求c++复数计算器1)所设计的复数计算器可以进行+ - * += -= *= ++ -- >= =

求c++复数计算器1)所设计的复数计算器可以进行+ - * += -= *= ++ -- >= =
求c++复数计算器1)所设计的复数计算器可以进行+ - * += -= *= ++ -- >= =

求c++复数计算器1)所设计的复数计算器可以进行+ - * += -= *= ++ -- >= =
class Complex
{
public:
Complex(){
re=0.0f;
im=0.0f;
}
Complex(float _re,float _im)
{
re = _re;
im = _im;
}
Complex(const Complex &complex)
{
*this = complex;
}
// operators:
Complex &operator=(const Complex &c)
{
re = c.re;
im = c.im;
return *this;
}
Complex operator+(const Complex &c)
{
return Complex(re+c.re,im+c.im);
}
Complex operator-(const Complex &c)
{
return Complex(re-c.re,im-c.im);
}
Complex operator*(const Complex &c)
{
return Complex(re*c.re - im*c.im,re*c.im + im*c.re);
}
Complex operator+=(const Complex &c)
{
*this = *this+c;
return *this;
}
Complex operator-=(const Complex &c)
{
*this = *this-c;
return *this;
}
Complex operator*=(const Complex &c)
{
*this = *this*c;
return *this;
}
//++ ,虚实都各加1
//前置
Complex &operator++(void)
{

return *this = *this+Complex(1,1);
}
Complex &operator--(void)
{
return *this = *this-Complex(1,1);
}
//后置
Complex operator++(int t)
{
t =0;
Complex temp = *this;
++*this;
return temp;
}

Complex operator--(int t)
{
t =0;
Complex temp = *this;
--*this;
return temp;
}
bool operator==(const Complex &c)
{
return (re==c.re && im==c.im);
}
bool operator!=(const Complex &c)
{
return !(*this==c);
}
//模比较?下面的都是
bool operator>(const Complex &c)
{
return ((re*2+im*2) > (c.re*2+c.im*2));
}
bool operator=(const Complex &c)
{
return !(*thisb)
a=Complex(1,1);
if(a=b)
a=Complex(1,1);
if(a

求c++复数计算器1)所设计的复数计算器可以进行+ - * += -= *= ++ -- >= = 求一款可以算复数的计算器 求c++复数计算器1)建立数据类、复数类2)数据、复数信息的初始化3)复数信息的输出4)将复数信息保存为文件5)求复数的绝对值6)实现复数的加、减、乘、除、乘方、自加、自减等运算 kenko计算器怎么计算复数 急.设计一个桌面计算器,能够进行实数或复数的四则运算.复数的四则运算这个如果不用界面,我会写(要求用C)!最重要的是,我不知道怎么把它窗口化.求各位大侠,怎么让它有按钮什么的.最好 卡西欧FX4500计算器怎么计算复数的辐角阿 计算arctan 求!诺基亚智能机计算器,要求能算复数!复数!诺基亚n78 卡西欧计算器复数功能如何调出 卡西欧计算器fx95es 怎么进行复数运算 我想买带复数运算的计算器,复数键有什么标识?计算器上的复数键的实部用re,虚部用img,请指教, 用C++编写复数计算器的程序【基本要求】为复数定义一个类,设计一个小型复数计算器,实现复数的设置和现实;实现附属加减乘除功能;实现用运算符==进行复数的相等比较,并显示比较结果. 用C语言设计计算器所包含主要知识点 求复数计算器如题,就是一个软件,算题目用的.不要什么编码,我不懂. 设计一个计算器程序要求可以进行加减乘除的运算,复数的运算,矢量和的运算.急啊,亲们,谢谢了~~~~ 计算器的C. 怎么用学生计算器计算电路中的向量或复数其结果仍为向量或复数形式(举例) 怎么使用科学计算器上的rec pol进行复数运算? KD-82TL计算器怎么算复数啊?电路里要用到的!急用!