java输出99乘法表

public class Demo {
public static void main(String[] args) {
for (int i = 1, j = 1; i <= 9; i++) {
System.out.print(i + "*" + j + "=" + i * j + ";");
if (i == j) {
i = 0;
j++;
System.out.println();
}
}
}

}


public class Demo {
public static void main(String[] args) {
int i;
int j;
for (i = 1; i <= 9; i++) {
for (j = 1; j <= i; j++) {
System.out.print(j + "*" + i + "=" + j * i +"\t" );
}
System.out.println();
}
}
}

你可能感兴趣的:(java,99)