Var i,s:integer; a:array[1..10]of integer; procedure sum(a:integer; var s:integer); begin if (a mod 2=0) and (a<0) then s:=s+a end; begin write('Массив: '); for i:=1 to 10 do begin a[i]:=random(-10,10); write(a[i],' '); sum(a[i],s) end; writeln; writeln('s=',s) end.
i,s:integer;
a:array[1..10]of integer;
procedure sum(a:integer; var s:integer);
begin
if (a mod 2=0) and (a<0) then
s:=s+a
end;
begin
write('Массив: ');
for i:=1 to 10 do
begin
a[i]:=random(-10,10);
write(a[i],' ');
sum(a[i],s)
end;
writeln;
writeln('s=',s)
end.