标签:red demo bsp str ring color void i++ span
package com.steven.demo; /** * 打印 5行的三角形 */ public class SquareDemo { public static void main(String[] args) { for (int i = 1; i < 6; 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(); } } }
package com.steven.demo; /** * 打印 5行的三角形 */ public class SquareDemo { public static void main(String[] args) { for (int i = 1; i < 6; 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(); } } }
标签:red demo bsp str ring color void i++ span
原文地址:https://www.cnblogs.com/stevenx/p/12990147.html