public static void main(String[] args) { for (int i = 1; i < 5; i++){ for (int j = 5; j >= i; j--){ System.out.print(" "); } for (int j = 1; j <= i; j++){ System.out.print("*"); } for (int j = 1; j < i; j++){ System.out.print("*"); } System.out.println(); } }输出结果:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)