Java基础50道经典练习题(16)——九九乘法表

【程序 16 输入 9*9 表】
题目:输出 9*9 口诀。
 
程序分析:分行与列考虑,共 9 行 9 列,i 控制行,j 控制列。
 
源码:
package com.homework.test;

/*
【程序 16 输入 9*9 表】
题目:输出 9*9 口诀。
程序分析:分行与列考虑,共 9 行 9 列,i 控制行,j 控制列。
 */
public class Test16 {
    public static void  main(String[] args){
        for (int i = 1; i<=9; i++){
            for (int j=1; j<=i; j++){
                System.out.print(i + "*" + j + "=" + i*j + " ");
            }
            System.out.print("
");
        }

    }

}

  

原文地址:https://www.cnblogs.com/lcpp/p/13051387.html