?? arg.cpp
字號:
//arg.cpp
// Illustrate the use of each of the complex friend functions.
#include <complex.h> // This also includes iostream.h.
#include <conio.h>
void main(void)
{
complex<double> z(3.1, 4.2);
cout << "z = " << z << "\n";
cout << " 實數部分 = " << real(z) << "\n";
cout << " 虛數部分 = " << imag(z) << "\n";
cout << "z 的共扼復數= " << conj(z) << "\n";
double mag = sqrt(norm(z));
double ang = arg(z);
cout << "z的極坐標:\n";
cout << "大小 = " << mag << "\n";
cout << "角弧度 = " << ang << "\n";
cout << "有極坐標再轉換為復數:\n";
cout << " z = " << polar(mag,ang) << "\n";
getch();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -