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 Answers
+ 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