1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #include <stdio.h> void main() { FILE *fp; char filename[40] ; int i,j ; float da[6][5] = {0} ; fp=fopen("D:\\test.xls","r"); fseek(fp, 0, SEEK_SET); for(i = 0 ;i < 6 ; i++) for(j = 0 ;j < 5 ; j++) { fscanf(fp,"%f",&da[i][j]); fseek(fp, 1L, SEEK_CUR); } for(i = 0 ;i < 6 ; i++) printf("%f\t%f\t%f\t%f\t%f\t\n",da[i][0], da[i][1],da[i][2],da[i][3],da[i][4]);
getchar() ; }
|