// 使用for循环输出星号三角形public class {
// 使用for循环输出星号三角形
public class StarTriangle {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
for (int j = 0; j < i; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
// 输出结果:
// *
// **
// ***
// ****
// *****
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(23条)