UVa232纵横字谜

#include
#include
#define maxn 15

void AA(int a[maxn][maxn],char maps[maxn][maxn],int r,int c);
void Down(char maps[maxn][maxn],int a[maxn][maxn],int r,int c);

int main(){
int i,j,r,c,flag=0,key=1;int a[maxn][maxn];
char maps[maxn][maxn];
while(scanf("%d",&r) && r!=0){
scanf("%d",&c);
getchar();
for(i=0;i0)
printf("\n");
printf("puzzle #%d:\n",key++);
printf("Across\n");
for(i=0;i= 1 && a[i][j] <= rc){
printf("%3d.",a[i][j]);
for(j;j='A' && maps[i][j]<='Z'){
putchar(maps[i][j]);
continue;
}
if(maps[i][j] == ''){
break;
}
}
printf("\n");
}
}
Down(maps,a,r,c);
}
return 0;
}

//给起始格编号
void AA(int a[maxn][maxn],char maps[maxn][maxn],int r,int c){
int i,j,key=1;
memset(a,0,sizeof(int));
for(i=0;i= 1 && a[i][j] <= rc){
printf("%3d.",a[i][j]);
key=i;
for(key;key='A' && maps[key][j]<='Z'){
a[key][j]=0;
putchar(maps[key][j]);
continue;
}
if(maps[key][j] == ''){
break;
}
}
printf("\n");
}
}

}

你可能感兴趣的:(OnlineJudge)