📄 生成w因子表.cpp
字号:
//整体替代main函数#define PI 3.141592struct complex{ short real,image;};void w_factor(int N){ complex *w_temp = new complex[N/2]; int j=1,k; printf("%s%d%s%d%s","short w",N/2,"[",N,"] = {\n"); for(k=0;k<N/2;k++) { w_temp[k].real = short(32767*cos(2*PI*k/N)); w_temp[k].image = - short(32767*sin(2*PI*k/N)); if(k!=N/2-1) printf("%d%s%d%s",w_temp[k].real,",",w_temp[k].image,", "); else printf("%d%s%d",w_temp[k].real,",",w_temp[k].image); //控制输出格式 j++; if(j % 5 == 0) { printf("\n");j=1;} } printf("};"); printf("\n\n");}int main(){ int i; for(i=1;i<11;i++) { w_factor(1<<i); } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -