C语言 关于生成一个10x10字符数组随机步的问题,请问错误到底是咋回事,字符串数组到底应该如何定义呢,这个程序应该怎么改变#include<stdio.h>#include<stdlib.h>#include<time.h>#include<string.h>#define MAXX 10#define MAXY 10int main(){ int m,n; char a[MAXX][MAXY]; for(m=0;m<MAXX;m++){ for(n=0;n<MAXY;n++){ a[m][n]="."; } } char str[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; srand((unsigned)time(NULL)); int i=0,j=0,k=0; while(k<=25){ if(rand()%4==0&&i-1>=0&&a[i-1][j]=='.'){ a[i][j]=str[k]; i++;k++; } else if(rand()%4==1&&i+1<MAXX&&a[i+1][j]=='.'){ a[i][j]=str[k]; i++;k++; } else if(rand()%4==2&&j-1>=0&&a[i][j-1]=='.'){ a[i][j-1]=str[k]; j--;k++; } else if(rand()%4==3&&j+1<MAXY&&a[i][j+1]=='.'){ a[i][j+1]=str[k]; j++;k++; } else{ break; } } int q,w; for(q=0;q<MAXX;q++){ for(w=0;w<MAXY;w++){ printf("%s\t",a[q][w]); } printf("\n"); } return 0;}