4 3 2 1
3 2 1
2 1
1
急!!
用双重循环语句实现打印下列图形
4 3 2 1
3 2 1
2 1
1
请输入答案
public class kfc {
public static void main(String[] args) {
for(int z=4;z>=1;z--){
for(int z1=z;z1>=1;z1--){
System.out.print(z1);
if(z1==1) System.out.println();
else System.out.print(" ");
}
}
}
}
public static void main(String[] args) throws IOException {
for (int i=5;i>0;i--){
for(int j=1;j<i;j++){
System.out.print(i-j+" ");
}
System.out.println();
}
}
package com.example.demo003;
public class Test03 {
public static void test(int size) {
for (int i = 0; i < size; i++) {
for (int j = size - i; j > 0; j--) {
System.out.print(j);
System.out.print(" ");
}
System.out.println("");
}
}
public static void main(String[] args) {
test(4);
}
}