/**
* @author Administrator
* 打印九九乘法表如下:
1*1 = 1
1*2 = 2 2*2 = 4
1*3 = 3 2*3 = 6 3*3 = 9
1*4 = 4 2*4 = 8 3*4 = 12 4*4 = 16
1*5 = 5 2*5 = 10 3*5 = 15 4*5 = 20 5*5 = 25
...
1*9 = 9 2*9 = 18 3*9 = 27 4*9 = 36 5*9 = 45 6*9 = 54 7*9 = 63 8*9 = 72 9*9 = 81
答案:
*/
public class Work6 {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(j +"*"+i+"="+j*i +"\t");//利用\t使下面格式对齐
}
System.out.println();
}
}
}
显示结果: