第一題:
請撰寫一 Java 程式,用以輸出下列的九九乘法表。【25 分】
申論題作答 (共 2 筆)
依時間顯示最近 2 筆。
詳解 (共 4 筆)
robyhung
詳解 #6280317
public class Main{ ...
(共 465 字,隱藏中)
前往觀看
小書僮Roy
詳解 #6327338
public class Multipl...
(共 373 字,隱藏中)
前往觀看
蔡恩林
詳解 #6200716
publicclass test99...
(共 200 字,隱藏中)
前往觀看
hchungw
詳解 #6231687
public class MultiplicationTable {
public static void main(String[] args) {
// Loop through columns
for (int i = 1; i <= 9; i++) {
// Loop through rows
for (int j = 1; j <= 9; j++) {
// Print each product with formatted output
System.out.printf("%d★%d=%-2d ", j, i, i * j);
}
// Move to the next line after each column
System.out.println();
}
}
}
public static void main(String[] args) {
// Loop through columns
for (int i = 1; i <= 9; i++) {
// Loop through rows
for (int j = 1; j <= 9; j++) {
// Print each product with formatted output
System.out.printf("%d★%d=%-2d ", j, i, i * j);
}
// Move to the next line after each column
System.out.println();
}
}
}