★第二种是第一种稍微优化
//乘法口诀表
①
for(int i = 1;i < 10;i++) {
for(int j = 1;j <= i;j++) {
if(i != j) {
System.out.print(j + "*" + i + "=" + j * i + " ");
}else {
System.out.println(j + "*" + i + "=" + j * i + " ");
}
}
}
②
for(int j = 1; j < 10;j++) {
for (int i = 1; i <= j;i++) {
System.out.print(i + "*" + j + "=" + i * j + " ");
}
System.out.println();
}
原文:https://www.cnblogs.com/shaonianteng/p/10391430.html