📜  数字乘法表Java代码示例

📅  最后修改于: 2022-03-11 14:52:44.689000             🧑  作者: Mango

代码示例2
public static String multiTable(int num) {
        StringBuilder sb = new StringBuilder();

        for (int i = 1; i <= 10; i++) {
            int result = i * num;
            sb.append(i + " * " + num + " = " + result + "\n");
        }
        return sb.toString().trim();
    }