/*题目:打印出如下图案(菱形) * *** ***** ******* ***** *** * */
public class Practice19 { public static void main(String[] args) { for (int i = 0; i < 7; i++) { //打印空格 for (int j = 0; j < Math.abs(3-i); j++) { System.out.print(" "); } //打印* for (int j = 0; j < -2*Math.abs(i-3)+7; j++) { System.out.print("*"); } //换行 System.out.println(); } } }