Const
m=10;
var
i,s,n,m1,m2:integer;
a:array[1..m]of integer;
begin
write('Исходный массив: ');
for i:=1 to m do
begin
a[i]:=random(-5,10);
write(a[i],' ');
end;
writeln;
repeat
write('Введите m1 и m2: ');
readln(m1,m2);
until (m1>0) and (m2>0) and (m1<=m) and (m2<=m);<br>n:=a[m1];
s:=a[m2];
write('Измененный массив: ');
for i:=1 to m do
begin
if a[i]<0 then a[i]:=a[i]+n<br> else a[i]:=a[i]+s;
write(a[i],' ');
end;
end.