时间:2021-04-16 08:26:25 | 栏目:C代码 | 点击:次
实例如下:
#include<stdio.h> #include<stdlib.h> #define maxn 200 void main() { FILE *fp; int s[maxn][maxn]; int i,j; if((fp=fopen("d:\\temp\\test.txt","r"))==NULL) { printf(" can't open"); exit(0); } for(i=0;i<maxn;i++) { for(j=0;j<maxn;j++) { fscanf(fp,"%d",&s[i][j]); } } }