用for打印一个三角形
作者:互联网
package com.qiqi.struce;
public class ForDemo05 {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
for (int j = 5; j >=i ; j--) {
System.out.print(" ");
}
for (int j = 1; j <= i; j++) {
System.out.print("7");
}
for (int j = 1; j < i; j++) {
System.out.print("7");
}
System.out.println();
}
}
}
标签:ForDemo05,一个,打印,System,int,print,三角形,public,out 来源: https://www.cnblogs.com/shuqiqi/p/16413056.html