返回列表 發帖
  1. package mhjh.kh.edu.tw;

  2. public class Main {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.       int  str[][][]= new int[2][3][4];
  6.       int l=1;
  7.       for(int i=0;i<=1;i++)
  8.       {
  9.              for(int j=0;j<=2;j++)
  10.              {
  11.                     for(int k=0;k<=3;k++)
  12.                     {                                             
  13.                       str[i][j][k]=l;
  14.                       l++;
  15.                     }       
  16.              }
  17.       }          
  18.      for(int result[][]:str)
  19.      {
  20.              for(int result1[]:result)
  21.              {
  22.                     for(int result2:result1)
  23.                     {
  24.                             System.out.println(result2);
  25.                     }
  26.              }         
  27.      }
  28.         }
  29. }
複製代碼

TOP

返回列表