java流程控制之 for循环 九九乘法表


package struct;

public class Demo08 {
    public static void main(String[] args) {
        for (int j = 1; j <= 9; j++) {
            for (int i = 1; i <= j; i++) {
                System.out.print(j+"*"+i+"="+(j*i)+"\t");
            }
            System.out.println();
        }


        System.out.println();
//        text2();

    }


    public  static  void  text2(){
        for (int j = 1; j <= 9; j++) {
            for (int i = 1; i <= j; i++) {
                System.out.print(j+"*"+i+"="+(j*i)+"\t");
            }
            System.out.println();
        }


    }
}

运行结果

posted @ 2021-07-29 09:49  阿向向  阅读(150)  评论(0编辑  收藏  举报