返回列表 發帖

503-矩陣之和

  1. public class JPD05 {
  2.     final static int ROW = 2;
  3.     final static int COL = 3;

  4.     public static void main(String args[]) {
  5.         int A[][] = {{1,2,3}, {4,5,6}};
  6.         int B[][] = {{7,8,9}, {10,11,12}};
  7.         int C[][] = new int[ROW][COL];
  8.       
  9.         System.out.printf("陣列A的內容為(3x3):\n");   
  10.         show(A);
  11.       
  12.         System.out.printf("\n陣列B的內容為(3x3):\n");   
  13.         show(B);
  14.       
  15.         add(A, B, C);
  16.       
  17.         System.out.printf("\n陣列A+B=C,陣列C的內容為(3x3):\n");   
  18.         show(C);
  19.     }
  20.    
  21.     public static void add(________________) {
  22.         ...
  23.     }
  24.    
  25.     public static void show(________) {
  26.         ...
  27.     }
  28. }
複製代碼
Stay hungry,
Stay foolish.

返回列表