program lab2 var ir jr value integer AL array 13 of integer begin AL A

 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
program lab2;
var i, K, ir, jr, value: integer;
AL, J: array[0..13] of integer;
begin
AL[0]:=0; AL[1]:=5; AL[2]:=2; AL[3]:=0; AL[4]:=7; AL[5]:=0; AL[6]:=4; AL[7]:=6; AL[8]:=1; AL[9]:=0; AL[10]:=3; AL[11]:=9; AL[12]:=0; AL[13]:=0;
J[0]:=1; J[1]:=2; J[2]:=3; J[3]:=2; J[4]:=3; J[5]:=3; J[6]:=2; J[7]:=4; J[8]:=5; J[9]:=4; J[10]:=2; J[11]:=5; J[12]:=5; J[13]:=0;
writeln('AL = [', AL, ']');
writeln('J = [', J, ']');
read(ir);
read(jr);
for i := 0 to 13 do begin
if (AL[i] = 0) then begin
K := J[i];
continue;
end;
if((J[i] = jr) and (K = ir)) then begin
value := Al[i];
break;
end;
end;
writeln('A[', ir, ',', jr, ']', ' = ', value);
end.