楼主的提问不合格,你应该贴出你需要的结果图,否则别人只能瞎猜你想要的效果
我来瞎猜一下
程序代码:
#include <stdio.h>
#define SIZE 16
int main(void)
{
const char* alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char* reverse = "ZYXWVUTSRQPONMLKJIHGFEDCBA";
for( int i=0; i<SIZE; ++i )
printf( "%*s%.*s%s\n", SIZE-i-1, "", 1+i, alpha, reverse+26-i );
return 0;
}
输出为
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA