/*
*
* *
* * *
* * * *
* * * * *
*/
public class Demo {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {//控制几行的
for (int j = 1; j <= 5-i; j++) {//控制几列的,倒三角
System.out.print(" ");
}
for (int y = 1; y <=i; y++) {//并排输出列里面的东西,正三角
System.out.print("* ");
}
System.out.println();
}
}
}
|
|