/**
* @打印一个菱形ABCBA
*/
public static void main(String[] args) {
System.out.println("请输入三角形的行数");
Scanner scanner = new Scanner(System.in);
int line = scanner.nextInt();
for (int i = 0; i < 2 * line - 1; i++) {
if (i <= line - 1) {
for (int j = line - 1 - i; j >= 0; j--) {
System.out.print(" ");
}
for (char item = 65; item <= i + 65; item++) {
System.out.print(item);
}
for (char item = (char) (65 + i - 1); item >= 65; item--) {
System.out.print(item);
}
} else {
for (int j = 0; j <= i - line + 1; j++) {
System.out.print(" ");
}
for (char item = 65; item <= (line - 2) + 65+(line-i); item++) {
System.out.print(item);
}
for (char item = (char) (65+line-3+(line-i)); item >= 65; item--) {
System.out.print(item);
}