package xuexi; public class ss { public static void main(String[] args) { int i; for (int h = 0; h <= 7; h++) { for(int s=7-h;s>0;s--) {System.out.print(" ");} int j = 1; for (int k = 0; k <= h; k++) { System.out.printf("%5d",j); j = j * 2; } int g = j/2; while(g!=1) { g = g /2; System.out.printf("%5d",g); } System.out.println(); } } }
将包名换一下即可使用哦
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)