const
n=30;
var
a:array [1..n] of integer;
i,sum:integer;
begin
sum:=0;
for i:=1 to n do
a[i]:=random(101)-50;
if (abs(a[i] mod 2) = 1) and (a[i]<0) then
sum:=sum+a[i];
write(a[i]:4);
end;
writeln;
write('sum: ',sum);
end.
const
n=30;
var
a:array [1..n] of integer;
i,sum:integer;
begin
sum:=0;
for i:=1 to n do
begin
a[i]:=random(101)-50;
if (abs(a[i] mod 2) = 1) and (a[i]<0) then
sum:=sum+a[i];
write(a[i]:4);
end;
writeln;
write('sum: ',sum);
end.