C++爱好者 请看 此程序哪里出问题,运行不出结果!!
//请问此程序哪里出问题,运行不出结果!!/*需打开的源文件d:\\123.txt内容
1.6 1.6 0.123 0.000 16
4.0 1.6 0.456 0.000 16
6.3 1.6 0.000 0.000 16
8.7 1.6 0.000 0.000 16
*/
#include <iostream>
void main()
{
int i,j,k;
float str[4][5];
FILE *fp=fopen("d:\\123.txt","r");
FILE *op=fopen("d:\\2.txt","w");
while (fscanf( fp,"%f",&str[k/5][k%5])!=EOF) k++;
for (i=0;i<4;i++)
{for (j=0;j<5;j++)
{ fscanf(op,"%f\t",&str[i][j]);
fprintf(op,"%f\t",str[i][j]);
printf("%f\t",str[i][j]);
};
fprintf(op,"\n");
printf("\n");
};
fclose(fp);
fclose(op);
}