以金字塔图案打印数字
public class exer19 {
public static void main(String[] args) {
System.out.println("Enter the number of lines: ");
Scanner input=new Scanner(System.in);
int num = input.nextInt();
for (int i = 0; i <num; i++) {
for (int k = num-1; k > i; k--) {
System.out.print("\t");
}
for (int j = 0; j <i; j++) {
System.out.print((int)Math.pow(2,j)+"\t");
}
for (int j = i; j >=0 ; j--) {
System.out.print((int)Math.pow(2,j)+"\t");
}
System.out.println();
}
}
}