ariestamirra

CariPanjangElemen

Apr 3rd, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. public class CariPanjangElemen {
  2. public static void main(String args[]) {
  3.     int x[][][][]=new int[2][][][];
  4.     x[0]=new int[1][][];
  5.     x[0][0]=new int[2][];
  6.     x[0][0][0]=new int[3];
  7.     x[0][0][1]=new int[2];
  8.     x[1]=new int[2][][];
  9.     x[1][0]=new int[1][];
  10.     x[1][0][0]=new int[2];
  11.     x[1][1]=new int[2][];
  12.     x[1][1][0]=new int[1];
  13.     x[1][1][1]=new int[3];
  14.     System.out.println(x.length);
  15.     System.out.println(x[0].length);
  16.     System.out.println(x[0][0].length);
  17.     System.out.println(x[0][0][0].length);
  18.     System.out.println(x[0][0][1].length);
  19.     System.out.println();
  20.     System.out.println(x[1].length);
  21.     System.out.println(x[1][0].length);
  22.     System.out.println(x[1][0][0].length);
  23.     System.out.println(x[1][1].length);
  24.     System.out.println(x[1][1][0].length);
  25.     System.out.println(x[1][1][1].length);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment