/*
* 解题思路:
* 解题步骤:计算最长字符串长度 -> 给字符串排序 -> 除最后一列为最长字符串长度,其他列均为最长字符串长度+2(输出该字符串,不足地方补空格)
*/
#include#include #define A 110 #define B 65 char s[ A ][ B ]; int cmp( const void *_a , const void *_b ) { char *a = (char *)_a; char *b = (char *)_b; return strcmp( a , b ); } void Paint( int x ,int y ) { int i; int len = strlen( s[ x ] ); printf("%s",s[ x ] ); for( i=len;i = n) continue; if( j == c-1 ) Paint( j*r+i , tmp ); else Paint( j*r+i , tmp+2 ); } puts(""); } } return 0; }