Uses crt; const n = 10; var a,b : array[1..n] of integer; i,j : integer; begin randomize; i := 0; j := 0; for i := 1 to n do begin a[i] := random(21)-10; write(a[i],' '); end; writeln; for i := 1 to n do if (a[i] < 0) and (a[i] mod 2 = 0) then begin j := j+1; b[j] := a[i]; end; for i := 1 to j do writeln(b[i]); readln; end.
const
n = 10;
var
a,b : array[1..n] of integer;
i,j : integer;
begin
randomize;
i := 0;
j := 0;
for i := 1 to n do
begin
a[i] := random(21)-10;
write(a[i],' ');
end;
writeln;
for i := 1 to n do
if (a[i] < 0) and (a[i] mod 2 = 0) then
begin
j := j+1;
b[j] := a[i];
end;
for i := 1 to j do
writeln(b[i]);
readln;
end.