/*
輸入最後一行需加上 Ctrl + Z
Run time: 0.000
*/
#include <stdio.h>
#include <string.h>
#define N 100
char arr[N+1][N+1];
int len[N+1];
int main()
{
int i, j;
int max = 0;
int level;
for ( i = 0; ; i++)
if (gets(arr[i]) == NULL)
break;
else
{
len[i] = strlen(arr[i]);
if (max < len[i])
max = len[i];
}
level = i;
for (i = 0; i < max; i++)
{
for ( j = level-1; j >= 0; j--)
{
if (arr[j][i] != '\0')
printf("%c", arr[j][i]);
else
printf(" ");
}
printf("\n");
}
return 0;
}
沒有留言:
張貼留言