古詩詞大全網 - 成語用法 - c語言中定義復數的問題

c語言中定義復數的問題

complex在各個C++標準中定義不壹致。如果妳是VS2012以上版本,這麽用應該沒問題,如果較低版本,推薦這樣使用:

#include?<stdio.h>

#include?<complex>

#include?<cstdlib>

using?namespace?std;

int?main()

{

complex<double>?cx,cy;

cx=complex<double>(1,3);

cy=complex<double>(1,4);

//do?your?things

return?0;

}