I have to do a stepped array, but I do not know how to do it so that at the time of asking the columns of the array are declared within the loop, the program should do this as many times as players put it.
Exit of the program
Enter the number of players: 3
Enter the number of games played by the player 1: 2
Enter the points of the match 1: 11
Enter match points 2: 15
Enter the number of games played by player 2: 3
Enter the points of the match 1: 8
Enter the points of the match 2: 5
Enter match points 3: 15
Enter the number of games played by player 3: 2
Enter the points of the match 1: 21
Enter match points 2: 18
I tried to do this, but only the last player fills me:
//Variables
System.out.print("Entra el número de jugadores: ");
int numjuga = Integer.parseInt(teclat.readLine());
int array[][] = new int[numjuga][];
int numparti = 0;
//Bucle para pedir partidos y puntuacion
for ( int i=0; i<array.length; i++ ) {
System.out.printf("Entra el número de partidos jugados por el jugado %d: ", i+1);
numparti = Integer.parseInt(teclat.readLine());
array = new int[numjuga][numparti];
for ( int k=0; k<array[0].length; k++ ) {
System.out.printf("Entra los puntos del partido %d: ",k+1);
array[i][k] = Integer.parseInt(teclat.readLine());
}
}