#include#include #include int main(){ char a[12][12],d[110][12]; int b[12][12]; int r,c,con=0; while(~scanf("%d",&r)) { memset(b,0,sizeof(b)); memset(d,0,sizeof(d)); if(r==0) break; con++; scanf("%d",&c); int x=0; for(int i=0; i 1) printf("\n"); printf("puzzle #%d:\n",con); int flag=0; printf("Across\n"); for(int i=0; i 0) { if(b[i][j]>1) printf("\n"); printf("%3d.",b[i][j]); flag=1; } if(flag) { if(a[i][j]!='*') printf("%c",a[i][j]); } } flag=0; } printf("\n"); flag=0; int p=0,q=0; printf("Down\n"); for(int i=0; i