1 package cn.zmh.demo1; 2 3 public class Test2 { public static void main(String[] args){ 4 5 for(int i = 9 ;i > 0 ;i-- ) { //外層for循環語句,控制行數 6 7 for(int j = 1 ;j <= i ; j++ ) { //內層for循環語句,控制每列的輸出列數和內容,k從9開始 8 9 System.out.print(i + "*" + j + "=" + (i * j) + "\t"); //輸出內容 10 11 } 12 13 System.out.println(); //同時換行輸出下一行內容 14 15 } 16 17 } 18 19 }