Multi Dimensional Arrays Practice l by CodeChum Admin

Viewed 78

Ask the user for the number of rows and columns of a two-dimensional array and then its integer elements.

Then, ask the user for another integer value which represents a boogeyman. A boogeyman is a value that we intend to find from a given array.

Find and output the coordinates of the boogeyman by this format:

"BOOGEYMAN LOCATED AT ROW {row_number}, COLUMN {column_number}!"

Input

  1. One line containing an integer for the number of rows

  2. One line containing an integer for the number of columns

  3. Multiple lines containing at least one integer each line for the elements of the array

Sample

1·4·2·3 9·1·2·3 4·2·1·1 9·2·8·3 4. One line containing an integer for the boogeyman's value

Output

Print the row of the position first and then the column of the position. Note that the row and the column is 0-based (i.e. it starts at 0 and not at 1).

It is guaranteed that the boogeyman exists and only once in the 2D array.

Enter·#·of·rows:·4 Enter·#·of·columns:·4 Elements: 1·4·2·3 9·1·2·3 4·2·1·1 9·2·8·3 Enter·the·boogeyman's·value:·8 BOOGEYMAN·LOCATED·AT·ROW·4,·COLUMN·3!

0 Answers
Related