该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
/*
0 0 0 0
0 1 1 1
0 1 2 2
0 1 2 3
*/
public class JuZhen
{
  public static void main(String[] args)
  {
    printArray(getArray(4));
  }
  private static void printArray(int[][] a)
  {
    for(int i=0;i
    {
      for(int j=0;j
      {
        System.out.print(" "+a[i][j]);
      }
      System.out.println();
    }
  }
  public static int[][] getArray(int index)
  {
    int a[][] =new int[index][index];
    for(int i=0; i
      for(int j=0;j
      {
        if(i<=j )
          a[i][j]=i;
        if(j<=i )
          a[i][j]=j;
      }
    return a;
  }
}