1)
var
a:array[1..16] of integer;
i,k,s:integer;
begin
randomize;
For i:= 1 to 16 do
begin
a[i]:= -30+random(61);
write(a[i], ' ');
end;
For i:= 1 to 16 do
if a[i] < 0 then k:= k+1;
Writeln;
Writeln(k);
end.
Пример:
-21 4 -11 30 -16 -7 26 -14 -20 10 -18 8 -26 -13 -20 -15
11
2)
Изменить условие "if a[i] < 0 then k:= k+1;" на "if a[i] > 0 then s:= s +a[i];"
и "writeln(k);" на "Writeln(s);"