practice 3 打印九九乘法表(重点,思维)
-
先打印第一列,1×1~1×9
-
把固定的1用另一个循环体包起来
-
去掉重复项:i<=j
-
1 package Day07; 2 3 public class Java07_16 { 4 public static void main(String[] args) { 5 for (int j = 1; j <= 9; j++) { 6 for (int i = 1; i <= j; i++) { 7 System.out.print(i+"*"+j+"="+i*j+"\t"); 8 } 9 System.out.println(); 10 } 11 } 12 }