用java输出九九乘法表,每个表达式的乘法结果长度为3
时间: 2024-05-15 10:19:08 浏览: 49
下面是用Java输出九九乘法表,每个表达式的乘法结果长度为3的代码:
```
public class MultiplicationTable {
public static void main(String[] args) {
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
int result = i * j;
String resultStr = String.format("%3d", result);
System.out.print(j + " x " + i + " = " + resultStr + " ");
}
System.out.println();
}
}
}
```
阅读全文