0

Arreglos (otra vez)

¿Cómo es posible obtener la entrada del usuario para un dato en un arreglo bidimensional?

3rd Nov 2017, 5:44 AM
Saúl Chávez Sánchez
Saúl Chávez Sánchez - avatar
2 Respostas
+ 1
One example: int a[FIRST_DIMENSION][SECOND_DIMENSION]; for (i=0; i<FIRST_DIMENSION; i++) { cout << "Enter " << SECOND_DIMENSION << " values for row " << i << endl; for (j=0; j<SECOND_DIMENSION; j++) { cout << "Value " << j << ": "; cin >> a[i][j]; } } But the approach depends on the task. For example, you may use a GUI grid.
5th Nov 2017, 8:36 AM
deFault
0
Thank you!
5th Nov 2017, 1:59 PM
Saúl Chávez Sánchez
Saúl Chávez Sánchez - avatar