读数据+遍历行数程序 记录一个度数+遍历行数的程序 FILE* file2; int row2 = 0; file2 = fopen("D://sins_mat2.txt", "r"); // file1 = fopen("D://ga_mat2.txt", "r"); if (file2 == NULL) {printf("open file1 failed.\n");return 0; } while (!feof(file2)) {if (fgetc(file2) == '\n')//864000{row2++;} } printf("%d \r\n ", row2);