每日一练之乘法口诀打印

public class Chen3 {
    public static void main(String[] args) {
        /**
         * 乘法表
         * 使用while、for 循环*/
        int i = 1;
        int j = 1;
        int x = 1;
        for(i = 1;i < 10;i++) {
            for(j = 1;j <=i;j++){
              x = i*j;
                System.out.print(j + "*" + i + "=" + x+"\t");

            }
            System.out.println();
        }
    }
}

代码结果截图:
image-20210926215152815

posted on 2021-09-26 21:57  一只花小友  阅读(180)  评论(0)    收藏  举报

导航