#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]); } } }
原文地址:http://blog.csdn.net/u013018721/article/details/42008201