UVA 490
#include <stdio.h> #include <stdlib.h> #include <string.h> const int max=105; int main() { int i,j,k,han=0,len[max],maxlen=0; char a[max][max]; for (i=0;i<max;i++) { for (j=0;j<max;j++) { a[i][j]='\0'; } } i=0; while (gets(a[i])){ han++; len[i]=strlen(a[i]); if (maxlen<len[i]) maxlen=len[i]; i++; } for (j=0;j<maxlen;j++) { for (i=han-1;i>=0;i--) { if (a[i][j] == '\0' && i!=0) printf(" "); else printf("%c",a[i][j]); } printf("\n"); } system("pause"); return 0; }