99乘法表代码

    //打印99乘法表(倒三角形)
    private static void multiplicationtables2() {
        int x,y;
        for (y=9;y >= 1;y--){
            for (x=1;x <= y;x++){
                System.out.print(x + "*" + y + "=" + x*y + "\t");
            }
            System.out.println();
        }
    }

 

 

    //打印99乘法表(正三角形)
    private static void multiplicationtables1() {
        int x1,y1;
        for (x1=1;x1 <= 9;x1++){
            for (y1=1;y1 <= x1;y1++){
                System.out.print(x1 + "*" + y1 +"=" + x1*y1 + "\t");
            }
            System.out.println();
    }

 

posted @ 2022-05-13 17:02  xiaoyongdata  阅读(185)  评论(0编辑  收藏  举报