/*
* 解题思路:
* 需要注意、若超过某行长度、需用空格补上
* 利用gets( )按行读取、若读到结尾返回空 !
*/
#include <stdio.h>
#include <string.h>
#define A 110
int main( )
{
int i;
int l;
int maxLen;
int total;
char s[ A ][ A ];
int len[ A ];
total = 0;
l = maxLen = 0;
while( (gets( s[ total ])) !=NULL )
{
len[ total ] = strlen( s[ total ]);
if( len[ total ] > maxLen )
maxLen = len[total];
total++;
}
l = 0;
while( l++ < maxLen )
{
for( i=total-1;i>=0;i-- )
if( len[ i ] > l ) printf("%c",s[ i ][ l ] );
else printf(" ");
puts("");
}
return 0;
}