这是我到目前为止所拥有的。我最终进入了输入数组数字的无限循环,但是,就数字而言,它继续正确循环
static void ticketNumberArray(){
int number = 1; //which of the six numbers you need from the ticket
int ticketCount = 1; //which ticket (out of 20) you are currently on
while(ticketCount<21){ //sentinel controlled while loop, will continue until the twentieth ticket is entered
System.out.println("Please type number " +number+ " of ticket number " +ticketCount+ "."); //asks for the numbers of the ticket your currently on
Scanner keyboard = new Scanner(System.in); //initiates a scanner variable
int ticketNumber = keyboard.nextInt(); //assigns user input to the double variable ticketNumber and initializes as a double
tickets[ticketCount-1][number-1]=ticketNumber; //assigns user input into a 2-d array
number++; //Sentinel variable
if(number==7){ //loop that controls the ticket count, every 6 numbers ='s one ticket
ticketCount++;
number=1;
}
}
}