Java经典编程题50道之十六

输出九九乘法表。

public class Example16 {
    public static void main(String[] args) {
        table(9);
    }

    public static void table(int n) {
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + j * i+" ");
            }
            System.out.println();
        }
    }
}

原文地址:https://www.cnblogs.com/qubo520/p/6942052.html