Lesson_3 作业_3 输出字母金字塔

一、问题描述

输出下面图形:
      A
    ABC
  ABCDE
ABCDEFG

二、代码

 1 /***********************************************************
 2 *                 输出字符金字塔
 3 *                    2013-1-15
 4 ***********************************************************/
 5 
 6 public class 输出字符金字塔{
 7     public static void main(String []args){
 8         for(int i = 1; i <= 4; i++){
 9             for(int j = 4 - i; j > 0; j--){
10                 System.out.print(" ");
11             }
12 
13             for(int k = 1; k <= (2*i - 1); k++){
14                 System.out.print((char)(k + 64));
15             }
16             System.out.println();
17         }
18     }
19 }
原文地址:https://www.cnblogs.com/CocoonFan/p/2861709.html