The code is messy, and the time is too tight to sort out and the idea is not good ~ But AC ......
You can leave a message if you cannot see it clearly, or join QQ to discuss it.
# Include <stdio. h> # include <string. h ># include <iostream> using namespace STD; char s [11] [11]; int num [11] [11]; int vis [11] [11]; int main () {int R, C; int T = 0; while (scanf ("% d", & R )! = EOF) {If (r = 0) break; t ++; scanf ("% d", & C); For (INT I = 0; I <R; I ++) {scanf ("% s", s [I]);} // number; memset (Num, 0, sizeof (Num); memset (VIS, 0, sizeof (VIS); int T1 = 0; For (INT I = 0; I <r; I ++) {for (Int J = 0; j <C; j ++) {If (s [I] [J]! = '*') {If (I = 0) {num [I] [J] = ++ T1;} else if (j = 0) {num [I] [J] = ++ T1 ;} else if (s [I] [J-1] = '*' | s [I-1] [J] = '*') {num [I] [J] = ++ T1 ;}}// for (INT I = 0; I <r; I ++) // {// For (Int J = 0; j <C; j ++) // {// printf ("% d ", num [I] [J]); //} // printf ("\ n"); //} // output; If (T! = 1) printf ("\ n"); printf ("puzzle # % d: \ n", T); printf ("audio SS \ n"); int flag = 0; int cnt1 = 0; int flag1 = 1; for (INT I = 0; I <r; I ++) {for (Int J = 0; j <C; j ++) {If (s [I] [J] = '*' & flag) {flag = 0; printf ("\ n ");} if (s [I] [J]! = '*') {If (Num [I] [J]! = 0) {if (I = 0 & num [I] [J-1] = 0) printf ("% 3d. ", num [I] [J]); else if (I! = 0 & (j = 0 | s [I] [J-1] = '*') printf ("% 3d. ", num [I] [J]);} If (j = C-1) {printf (" % C \ n ", s [I] [J]); flag = 0;} else {printf ("% C", s [I] [J]); flag = 1 ;}}} printf ("down \ n "); for (INT I = 0; I <r; I ++) {for (Int J = 0; j <C; j ++) {If (Num [I] [J]! = 0) {if (I = 0) printf ("% 3d. ", num [I] [J]); else if (s [I-1] [J] = '*') printf (" % 3d. ", num [I] [J]);} If (s [I] [J]! = '*'&&! Vis [I] [J]) {for (int K = I; s [k] [J]! = '*' & K <r; k ++) {vis [k] [J] = 1; printf ("% C ", s [k] [J]);} printf ("\ n") ;}}} return 0 ;}
Ultraviolet A 232-crossword answers