Женьку

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
const
N=15;
var
A: array [1..N] of integer;
i, nar, p: byte;
BEGIN
randomize; p:=0; nar:=0;
for i:=1 to N do
begin
if not((p>-2) and (p<2)) then
begin
nar:=i-1; break;
end;
A[i]:=random(100); write(A[i]:3);
if (A[i] mod 2=0) then p:=p+1
else p:=p-1;
end; writeln;
writeln(nar);
END.