⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 复数计算,实现复数的加减乘除,求模,求主幅角,求共轭等功能
💻 CPP
字号:
// Test.cpp : Defines the entry point for the console application.
//	程序测试

#include "stdafx.h"
#include "Complex.h"
#include "iostream.h"

int main(int argc, char* argv[])
{	double k;
	Complex t1(1.0,1.0),t2(4.3f,2.2f);
	k=t1.Angle();
	t1.setComplex(-1,1);
	k=t1.Angle();
	t1.setComplex(-1,-1);
	k=t1.Angle();
	t1.setComplex(1,-1);
	k=t1.Angle();
	t1.setComplex(0,0);
	k=t1.Angle();
//	cout<<t1.getLeth()<<"\n";
	t2.setComplex(4,2);
	if(t1<t2)
		cout<<"OK\n";
	Complex t3;
	Complex t4;
	t3=t1*t2;
	t4=t3;
	t4.Conjutate();


		k=t2.Angle();	
		k=t3.Angle();
		k=t4.Angle();
	t3.Display();
	t4.Display();
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -