How to change this to 1D array?

الإجابة How to change this to 1D array?

  • 2012年4月16日 8:26
     
     

    any kind soul can help me to convert this to 1D array please?? I'm new to programming and I have no idea on how to change this to 1D...

      int[][] a = new int[][]   {new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},                            
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

            int[][] b = new int[][]{ new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};


            int x = 0;
            int y = 0;

全部回复