求教高手,C菜鸟,问下,我从文件中读入二维数组为什么不行啊
int main(){FILE *fin=fopen("transform.in","r");
FILE *fout=fopen("transform.out","w");
int n,i,j,s[12];
char a[10][10],b[10][10];
fscanf(fin,"%d",&n);
for(i=0;i<n;i++)
for(j=0;j<n;j++){
fscanf(fin,"%c",&a[i][j]);
}
for(i=0;i<n;i++)
for(j=0;j<n;j++)
fscanf(fin,"%c",&b[i][j]);
for(i=1;i<12;i++)
s[i]=i;
judge(a,b,s,n);
for(i=1;s[i]==0;i++);
fprintf(fout,"%d\n",s[i]);
return 0;
}
这是主程序
文件内容:
3
@-@
---
@@-
@-@
@--
--@