Const n=8;
var
a: array[1..n] of integer;
max,k: integer;
i: byte;
begin
k:=0;
max:=-100;
for i:=1 to n do begin;
read (a[i]);
if (a[i]<0) and (a[i]>max) then begin
max:=a[i];
k:=i;
end;
end;
writeln;
writeln ('max=',max,' k=',k);
end.
-----------------------------------
Пример:
2 -2 5 -5 9 -9 4 -4
max=-2 k=2