YIem`s Blog -心比天高命比纸薄-链接找不到的请在站内搜索内容！ - for 循环
type: channel
link: https://yiem.net/tag/for-%E5%BE%AA%E7%8E%AF/
items: For 循环各种*号

For 循环各种*号
type: item
date: 2017-10-27T22:41:00+08:00
description: For 循环各种*号 ***** **** *** ** * { int zz = 5; for (int i = 0; i < 5; i++) { for (int j = 0; j < zz; j++) { System.out.print("*"); } System.out.println(); zz--; } } { int zz = 0; for (int i = 0; i < 5; i++) { for (int j = zz; j < 5; j++) { System.out.print("*"); } System.out.println(); zz++; } } { for (int i = 0; i < 5; i++) { for (int j = i; j < 5; j++) { System.out.print("*"); } System.out.println(); } } * ** *** **** ***** { for (int i = 0; i < 5; i++) { for (int j = 0; j <= i; j++) { System.out.print("*"); } System.out.println(); } } * * * * * * * * * * * * * * * { for (int i = 1; i <= 5; i++) { for (int j = 1; j < i; j++) { System.out.print(" "); } for (int k = i; k <= 5; k++) { System.out.print("* "); } System.out.println(); } }