Const n=15;
var a:array[1..n] of integer;
i,k,max:integer;
begin
Randomize;
writeln('Массив A:');
for i:=1 to n do
begin
a[i]:=random(33)-15;
write(a[i]:4);
end;
writeln;
k:=0;
max:=-999;
for i:=1 to n do
begin
if a[i] mod 2 = 0 then k:=k+1;
if (a[i]>max)and(a[i]<0) then max:=a[i];<br> end;
writeln('k = ',k,' max = ',max);
end.
Пример:
Массив A:
14 5 5 7 -10 -13 -3 10 5 -2 -4 -5 3 -10 -14
k = 7 max = -2