既然是这样,可以推得不重复数组供有64组,因为标志只有000000~111111
九洲方除百尺冰,映秀又遭蛮牛耕。汽笛嘶鸣国旗半,哀伤尽处是重生。 -老K
治国就是治吏。礼义廉耻,国之四维。四维不张,国之不国。 -毛泽东
#include <stdio.h> #include <stdlib.h> int main() { FILE *fp; if ((fp = fopen ("D:\\wenjian.txt", "a+")) == NULL) { printf("打开文件失败\n"); exit(1); } for(int i = 0; i < 64 ; i++) { int n = i ; int m = i ; fprintf(fp,"i = %d \n",i); for (int j=0; j<13; ++j) fprintf(fp, "%3d ", j+1); fprintf(fp,"\n"); for(int j = 0; j < 6; j++) { for (int k=0; k<13; k++) fprintf(fp, "%3d ", n&1); fprintf(fp,"\n"); n = n>>1; } for(int j = 0; j < 6; j++) { for (int k=0; k<13; k++) fprintf(fp, "%3d ", !!(m&32)); fprintf(fp,"\n"); m = m<<1; } fprintf(fp,"\n"); } fclose(fp); return 0; }