返回列表 發帖

九九乘法表 (一)

本帖最後由 tonyh 於 2021-8-17 18:24 編輯

  1. public class Ch01 {

  2.         public static void main(String[] args) {
  3.                 for(int i=1; i<=9; i++)
  4.                 {
  5.                         for(int j=1; j<=9; j++)
  6.                                 System.out.print(i+"x"+j+"="+i*j+"\t");
  7.                         System.out.println();
  8.                 }
  9.         }
  10. }
複製代碼
  1. public class Ch01 {

  2.         public static void main(String[] args) {
  3.                 for(int i=1; i<=9; i++)
  4.                 {
  5.                         for(int j=1; j<=9; j++)
  6.                                 System.out.printf("%dx%d=%-2d  ",i, j, i*j);
  7.                         System.out.println();
  8.                 }
  9.         }
  10. }
複製代碼

返回列表