- public class NineNineMultiplicationTable {
- public void show() {
- for (int i = 1; i <= 9; i++) {
- for (int j = 1; j <= i; j++) {
- if (j == i) {
- System.out.print(j + "*" + i + "=" + i * j);
- } else {
- System.out.print(j + "*" + i + "=" + i * j + "\t");
- }
- }
- System.out.println();
- }
- }
- }
复制代码 |
|