include iostream using namespace std int main int dimension int AL int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
using namespace std;
int main() {
int dimension = 8;
int AL[8] = {5, 2, 7, 4, 6, 1, 3, 9};
int I[8] = {1, 1, 2, 3, 3, 3, 4, 4};
int J[8] = {2, 3, 3, 2, 4, 5, 2, 5};
int i, j;
cout << "Enter i: " << endl;
cin >> i;
cout << "Enter j: " << endl;
cin >> j;
int result = 0;
for (int _i = 0; _i < dimension; _i++) {
if(i == I[_i] and j == J[_i]) {
result = AL[_i];
}
}
cout << "Result: " << endl << result << endl;
return 0;
}