Damn question, it's been too long for AC
In ''rotating sentences, ''you are asked to rotate a series of Input sentences 90 degrees clockwise. so instead of displaying the input sentences from left to right and top to bottom, your program will display them
From top to bottom and right to left.
Input and Output
As input to your program, you will be given a maximum of 100 sentences, each not exceeding 100 characters long. legal characters include: newline, space, any punctuation characters, digits, and lower case or upper
Case English letters. (Note: tabs are not legal characters .)
The output of the program shocould have the last sentence printed out vertically in the leftmost column; the first sentence of the input wocould subsequently end up at the rightmost column.
Sample Input
Rene decartes once said, "I think, therefore I am ."
Sample output
"Rie nteh idnekc, A rttheesreofnocree SIA iadm ,."
Obviously, the output is correct, but it is always wa... I was speechless and felt that my boundary processing capability was not good. Let's take a look at Qingzhu's elegantCodeIt is also a good way to convert all the extra characters into spaces, so you don't have to worry about the boundary.
# Include <stdio. h> # include <string. h> char STR [110] [110]; int main () {int I, j, N, K; memset (STR, 0, sizeof (STR )); int size = 0, max = 0; while (gets (STR [size]) {n = strlen (STR [size]); If (n> MAX) max = N; size ++ ;}for (I = 0; I <size; I ++) for (j = 0; j <Max; j ++) if (! STR [I] [J]) STR [I] [J] = ''; For (j = 0; j <Max; j ++) {for (I = size-1; I> = 0; I --) printf ("% C", STR [I] [J]); printf ("\ n");} return 0 ;}