package practiceGO; /* * A * BC * DEF * GHIJ * KLMNO */ public class Cto { public static void main(String[] args) { char ch = ‘A‘; for(int i=0; i<5; i++){ for(int j=0; j<(i+1); j++){ System.out.print(ch); ch++; } System.out.println(); } } }
运行结果:
A BC DEF GHIJ KLMNO
原文地址:http://11317783.blog.51cto.com/11307783/1769211