打印九九乘法表,先上代码:
public static void multiplicationTable() {
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
// \t 跳到下一个TAB位置
System.out.print(j + "×" + i + "=" + i * j + "\t");
}
System.out.println();
}
}
思路: