发布网友 发布时间:2022-06-04 03:04
共2个回答
热心网友 时间:2023-10-26 09:06
public class TestBaiKnow {追问这个和梯形的哪里不同?
追答矩形的代码:
public class TestBaiKnow {
public static void main(String[] args) {
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= 9; j++) {
System.out.print(i + " * " + j + " = " + i * j + "\t");
}
System.out.println();
}
}
}
梯形的代码:
public class TestBaiKnow {
public static void main(String[] args) {
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(i + " * " + j + " = " + i * j + "\t");
}
System.out.println();
}
}
}
//不同点在第二个循环,对j值的判断。
热心网友 时间:2023-10-26 09:07
代码