public static void main(String[] args) {
for (int i = 1; i <=9; i++) {
System.out.println();
for (int j = 1; j < i+1; j++) {
System.out.print(j+"x"+i+"="+(j*i)+" ");
}
}
}
结果:
public static void main(String[] args) {
for (int i = 1; i <=9; i++) {
System.out.println();
for (int j = 1; j < i+1; j++) {
System.out.print(j+"x"+i+"="+(j*i)+" ");
}
}
}
结果: