package com.wanggenji.struct; public class TestDemo { public static void main(String[] args) { for (int i = 1; i <= 5; i++) { for (int j1 = 1; j1 <= 5-i; j1++) { System.out.print(" "); } for (int j2 = 1; j2 <= i; j2++) { System.out.print("*"); } for (int j3 = 1; j3 < i; j3++) { System.out.print("*"); } System.out.println(""); } } }