Const n=10; var a: array [1..n] of integer; i, k: integer; begin for i:=1 to n do begin write('a[', i, '] = '); readln(a[i]); end; for i:=1 to n do if a[i]<0 then begin write(a[i], ' '); k:=k+1; end; writeln; writeln('Количество: ', k); end.
Var i,k,n:integer; a,b:array[1..100] of integer; begin readln(n); for i:=1 to n do begin readln(a[i]); if a[i]<0 then begin b[k]:=a[i]; k:=k+1; end; end; write('Элементы: '); for i:=1 to k-1 do write(b[i],' '); writeln; writeln('Колличество отрицательных=',k-1); end.
var
a: array [1..n] of integer;
i, k: integer;
begin
for i:=1 to n do
begin
write('a[', i, '] = ');
readln(a[i]);
end;
for i:=1 to n do
if a[i]<0 then
begin
write(a[i], ' ');
k:=k+1;
end;
writeln;
writeln('Количество: ', k);
end.
a,b:array[1..100] of integer;
begin
readln(n);
for i:=1 to n do
begin
readln(a[i]);
if a[i]<0 then
begin
b[k]:=a[i];
k:=k+1;
end;
end;
write('Элементы: ');
for i:=1 to k-1 do write(b[i],' ');
writeln;
writeln('Колличество отрицательных=',k-1);
end.