user-0 提问: 这种效果怎么用for循环语序做出来啊？

回复:
user: user-1
content: 向2楼致敬！#include <stdio.h> #define abs(a) (a>0?a:-a) int C() {     static int c='A';     return (c++-'A')%26+'A'; } int main() {     for (int y=-9;++y!=9;putchar(                    '\n'))     for (int x=-9;++x!=9;putchar(abs(x)+abs(y)<9?C():'+' ));     return 0; } //++++++++A++++++++ //+++++++BCD+++++++ //++++++EFGHI++++++ //+++++JKLMNOP+++++ //++++QRSTUVWXY++++ //+++ZABCDEFGHIJ+++ //++KLMNOPQRSTUVW++ //+XYZABCDEFGHIJKL+ //MNOPQRSTUVWXYZABC //+DEFGHIJKLMNOPQR+ //++STUVWXYZABCDE++ //+++FGHIJKLMNOP+++ //++++QRSTUVWXY++++ //+++++ZABCDEF+++++ //++++++GHIJK++++++ //+++++++LMN+++++++ //++++++++O++++++++ //

user: user-2
content: 好，记号

user: user-3
content: 引用 4 楼 shangyu0801 的回复:牛，以数学坐标的思维解此题，条件比较好判断。 根据此题，x != y 稍微对程序改了一下，如下：   #include <stdio.h> // putchar #include <stdlib.h> // abs #define BACK '+' #define FRONT getletter() int getletter() { 	static int c = 'A'; 	return (c++ - 'A') % 26 + 'A'; } #define N 9 #define M 10 int main() { 	int x, y; 	for (y = -N; ++y != N; putchar('\n'))	 		for (x = -M; ++x != M; putchar(abs(x) + abs(y) < N ? FRONT : BACK)); 	return 0; }  结果如下，与题目相符： +++++++++A+++++++++ ++++++++BCD++++++++ +++++++EFGHI+++++++ ++++++JKLMNOP++++++ +++++QRSTUVWXY+++++ ++++ZABCDEFGHIJ++++ +++KLMNOPQRSTUVW+++ ++XYZABCDEFGHIJKL++ +MNOPQRSTUVWXYZABC+ ++DEFGHIJKLMNOPQR++ +++STUVWXYZABCDE+++ ++++FGHIJKLMNOP++++ +++++QRSTUVWXY+++++ ++++++ZABCDEF++++++ +++++++GHIJK+++++++ ++++++++LMN++++++++ +++++++++O+++++++++   4楼真细心。我按题意修改了一下  #include <stdio.h> // putchar #include <stdlib.h> // abs #define BACK '+' #define FRONT getletter() int getletter() { 	static int c; 	return c++ % 26 + 'A'; } #define N 9 #define X (N + 1) #define Y N int main() { 	int x, y; 	for (y = -Y; ++y != Y; putchar('\n'))	 		for (x = -X; ++x != X; putchar(abs(x) + abs(y) < N ? FRONT : BACK)); 	return 0; }

user: user-4
content: 引用 2 楼 ipqtjmqj 的回复: #include <stdio.h> // putchar #include <stdlib.h> // abs #define BACK '+' #define FRONT getletter() int getletter() { 	static int c = 'A'; 	return (c++ - 'A') % 26 + 'A'; } #define N 9 int main() { 	int x, y; 	for (y = -N; ++y != N; putchar('\n'))	 		for (x = -N; ++x != N; putchar(abs(x) + abs(y) < N ? FRONT : BACK)); 	return 0; }   牛，以数学坐标的思维解此题，条件比较好判断。 根据此题，x != y 稍微对程序改了一下，如下：   #include <stdio.h> // putchar #include <stdlib.h> // abs #define BACK '+' #define FRONT getletter() int getletter() { 	static int c = 'A'; 	return (c++ - 'A') % 26 + 'A'; } #define N 9 #define M 10 int main() { 	int x, y; 	for (y = -N; ++y != N; putchar('\n'))	 		for (x = -M; ++x != M; putchar(abs(x) + abs(y) < N ? FRONT : BACK)); 	return 0; }  结果如下，与题目相符： +++++++++A+++++++++ ++++++++BCD++++++++ +++++++EFGHI+++++++ ++++++JKLMNOP++++++ +++++QRSTUVWXY+++++ ++++ZABCDEFGHIJ++++ +++KLMNOPQRSTUVW+++ ++XYZABCDEFGHIJKL++ +MNOPQRSTUVWXYZABC+ ++DEFGHIJKLMNOPQR++ +++STUVWXYZABCDE+++ ++++FGHIJKLMNOP++++ +++++QRSTUVWXY+++++ ++++++ZABCDEF++++++ +++++++GHIJK+++++++ ++++++++LMN++++++++ +++++++++O+++++++++

user: user-3
content: #include <stdio.h> // putchar #include <stdlib.h> // abs #define BACK '+' #define FRONT getletter() int getletter() { 	static int c = 'A'; 	return (c++ - 'A') % 26 + 'A'; } #define N 9 int main() { 	int x, y; 	for (y = -N; ++y != N; putchar('\n'))	 		for (x = -N; ++x != N; putchar(abs(x) + abs(y) < N ? FRONT : BACK)); 	return 0; }

user: user-4
content: #include <stdio.h>  int Print(int x) { 	int start,i,ch; 	if(x % 2 != 1 || x < 5) 	{ 		return -1; 	} 	start = 1; 	ch = 0; 	for( i = 0; i < x; i++) 	{ 		int a,b,c,j; 		a = (x - start) /2; 		b = start; 		c = x - a - b;  		for( j = 0; j < a; j++) 		{ 			printf("+"); 		} 		for( j = 0; j < b; j++) 		{ 			printf("%c",ch++ % 26 + 'A'); 		} 		for( j = 0; j < c; j++) 		{ 			printf("+"); 		} 		printf("\n");  		if(i >= (x - 2)/2) 		{ 			start -= 2; 		} 		else 		{ 			start += 2; 		} 		if(start < 0)break; 	}  	return 0; }   int main() { 	Print(17);  满足你的要求。