Write the string from bottom to bottom, right to left, and change the space to '_'. Press enter '\',.
The translation will work in turn. Remove the trailing space ..
I don't know why, the character array is inside the loop, but every time it is not initialized, an error occurs...
# Include <iostream> # include <cstring> using namespace STD; int main () {int L; while (scanf ("% d", & L )! = EOF) {char ch [1001] [1001]; char res [1001]; for (INT I = 0; I <1001; I ++) {res [I] = '\ 0';} For (INT I = 0; I <L; I ++) {scanf ("% s ", ch [I]);} int Len = strlen (CH [0]); int Pos = 0; For (INT I = len-1; I> = 0; I --) {for (Int J = L-1; j> = 0; j --) {If (CH [J] [I] = '_') res [POS ++] = ''; else if (CH [J] [I] = '\') RES [POS ++] = '\ n '; else res [POS ++] = CH [J] [I] ;}for (INT I = pos-1; Res [I] = ''; I --) {res [I] = '\ 0';} printf ("% s \ n", Res);} return 0 ;}