"R
Ie
N
te
h
ID
NE
KC
, a
R
TT
He
es
R
EO
fn
OC
Re
e
s
Ia
I
AD
m,
.
"
Language:c++ 4.8.2
#include <stdio.h> #include <string.h> #define MAXN 100+10char str[maxn][maxn];int main (void) {memset (str, 0 , sizeof (str)); int count = 0;while (Fgets (Str[count], MAXN, stdin)! = NULL) count++;//program execution here, count represents the number of read-in sentences int max_ length = 0;for (int i = 0; i < count; i++) {int length = strlen (Str[i]); if (Max_length < length) max_length = length;} max_length--; In the absence of this line, the program WA, which is determined by the characteristics of the fgets, because the string will end with ' \ n ' and ' s ', if we open enough space. int row, col;for (row = 0; row < max_length; row++) {for (col = 0; col < count; col++) {int ch = str[count-1-col][row];i F (ch = = ' + ' | | ch = = ' \ n ') Putchar ("); else Putchar (CH);} Putchar (' \ n '); Note: If the line is pre-added with the statement if (row! = max_length-1), it will also WA, the reason for their own experience. }return 0;}
PS: Began to understand the wrong test instructions, thought that the number of input characters per line is incremented, resulting in a No.
uva_490:rotating sentences