Write a program that works as follows:
Prompt the user to enter a one dimensional array A with 3 integers.
Prompt the use to enter a two dimensional array B with 3*3 integers.
Check whether A is exactly a row or a column in B.
Print the row index or column index of A in B, or -1 if B does not contain A.
Sample
Input: (The grids are not part of input):
1 2 3
1 1 7
3 2 8
9 3 6
Output:
Column 1
Input: (The grids are not part of input):
1 2 3
1 1 7
3 2 8
1 2 3
Output:
Row 2
Input: (The grids are not part of input):
1 2 3
1 1 7
3 2 8
1 9 3
Output:
-1
Comments
Leave a comment