FILE *fp = fopen("data.txt","r");int a[4][5];for(int i=0;i<4;i++) for(int j=0;j<5;j++) fscanf(fp,"%d",&a[i][j]);此时矩阵就被保存到二维数组a[4][5]中。