/*
* 解題思路:
* 解題步驟:計算最長字符串長度 -> 給字符串排序 -> 除最後一列為最長字符串長度,其他列均為最長字符串長度+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; }