1. int i;
    2. FILE* file;
    3. if ((file = fopen ("D:\\q.txt","w+" )) == NULL)//打开操作不成功
    4. {
    5. printf("The file can not be opened.\n");
    6. exit(1);//结束程序的执行
    7. }
    8. printf("The result are as follows:\n");
    9. for (i = 0; i < 4410; i++)
    10. {
    11. printf("%lf", y[i].real);
    12. //if (y[i].img >= 0.0001)printf("+%lfj\n", y[i].img);
    13. //else if (fabs(y[i].img) < 0.0001)printf("\n");
    14. //else printf("%lfj\n", y[i].img);
    15. fprintf(file, "%f,", y[i].real);
    16. }
    17. fclose(file);