阅读背景:

为什么我的数组里没有“?”

来源:互联网 
    public class MakeQuilt {

public static void main (String[] args){

  char [][] myBlock = new char [4][5];
  char [][] myQuilt = new char [12][4];

  for(int row = 0; row < myBlock.length; row++){
      for(int column = 0; column < myBlock[row].length; column++){
         if(column == 0 || row == 3)
            myBlock[row][column]='X';
         else if(row ==  column || (row == 2 && column == 1))
            myBlock[row][column]='+';
         else
            myBlock[row][column]='.';    
      }   
     }
    displayPattern(myBlock);
    displayPattern(myQuilt);
  }



  public static void displayPattern(char[][] myBlock){

   for(int row = 0; row < myBlock.length; row++){
      for(int column = 0; column < myBlock[row].length; column++){
         System.out.print(myBlock[row][column]);
          }
          System.out.println();
         }
         System.out.println();    
   }

    public static void fillQuilt(char[][] myQuilt){   
   for(int row = 0; row < myQuilt.length; row++){
      for(int column = 0; column < myQuilt[row].length; column++){
         myQuilt[row][column] =('?');
        }
  }
 }
}
    public class MakeQuilt {

public static voi



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: