返回列表 發帖
  1. package site.istak.org.tw;
  2.                        
  3. public class Main {
  4.                        
  5.                 public static void main(String[] args) {
  6.                        
  7.                                 int [] [] num = new int [2][2];

  8.                                 for( int i=0 ; i<num.length ; i++)
  9.                                 {
  10.                                                 for(int j=0 ; j<num.length ; j++)
  11.                                                 {
  12.                                                 num [ i ][ j ] = j;
  13.                                                 }
  14.                                 }
  15.                                 for(int[] a : num)
  16.                                 {
  17.                                         for(int i=0 ; i<a.length;i++)
  18.                                         {
  19.                                         System.out.println(a[i]);
  20.                                         }
  21.                                 }
  22.         }
  23. }
複製代碼

TOP

返回列表