program lab2 var jd integer AL array 13 of integer array of integer in

 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
program lab2;
var t, i, k, jd: integer;
AL, J:array[0..13] of integer;
A: array[0..4,0..4] of integer;
c: integer;
jc: integer;
ir: integer;
jr: integer;
xc: integer;
value: 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);
writeln(J);
//readln(ir);
//readln(jr);
for i := 0 to 4 do begin
//writeln(A[i]);
end;
ir := 1;
jr := 1;
for i := 0 to 13 do begin
if ((AL[i] = 0) and (J[i] = jr)) then begin
for jd := i + 1 to i + ir do begin
if (AL[jd] = 0) then break;
value := AL[jd];
end;
end;
end;
writeln(value);
end.