编写一个java程序。 打印 99 表11=112=2 22=413=3 23=6 33=914=4 24=8 34=12 44=1615=5 25=10 35=15 45=20 55=2516=6 26=12 36=18 46=24 56=30 66=3617=7 27=14 37=21 47=28 57=35 67=42 77=4918=8 28
public class MultiplicationTable {
public static void main(String[] args) {
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(j + "*" + i + "=" + (i * j) + " ");
}
System.out.println();
}
}
}
输出结果:
11=1
12=2 22=4
13=3 23=6 33=9
14=4 24=8 34=12 44=16
15=5 25=10 35=15 45=20 55=25
16=6 26=12 36=18 46=24 56=30 66=36
17=7 27=14 37=21 47=28 57=35 67=42 77=49
18=8 28=16 38=24 48=32 58=40 68=48 78=56 88=64
19=9 29=18 39=27 49=36 59=45 69=54 79=63 89=72 9*9=81
原文地址: http://www.cveoy.top/t/topic/jaVf 著作权归作者所有。请勿转载和采集!