English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

Just go through every elements in 2D integer array to select the maximum value.
Ex (code in C++):

int max = a[0][0];
for (int i=0; i for (int j=0; j {
if (max < a[i][j])
max = a[i][j];
}

2006-12-13 14:54:23 · answer #1 · answered by -=MISA Returns=- 1 · 0 0

that's not that complicated. in spite of the undeniable fact that it quite is a 2-dimensional array, you're in uncomplicated terms getting access to one ingredient of the 1st array. so which you cope with it basically like a known array. the only distinction is that interior the for loop, rather of array[i], you will possibly use array[a million][i], or something comparable.

2016-10-14 22:00:08 · answer #2 · answered by didden 4 · 0 0

fedest.com, questions and answers