1)
uses crt;
const n=8;
var i:integer;
a:array[1..n] of integer;
begin
writeln('Input elements.');
for i:=1 to n do
read(a[i]);
for i:=1 to n do
if a[i]<0 then<br>write(a[i],' ');
end.
2)
uses crt;
const n=10;
var i,t:integer;
a:array[1..n] of integer;
begin
randomize;
t:=0;
write('Массив: ');
for i:=1 to n do
begin
a[i]:=random(10,1);
write(a[i],' ');
if a[i] mod 2=0 then
t:=t+1;
end;
writeln(#13#10,t);
end.
3)
uses crt;
const n=10;
var i,sum,t:integer;
a:array[1..n] of integer;
begin
randomize;
sum:=0;
t:=0;
write('Массив: ');
for i:=1 to n do
begin
a[i]:=random(10,1);
write(a[i],' ');
if a[i] mod 2=0 then
sum:=sum+a[i]
else
t:=t+1;
end;
writeln(#13#10,sum,' ',t);
end.
4)
uses crt;
const n=10;
var i:integer;
a:array[1..n] of integer;
begin
randomize;
for i:=1 to n do
begin
a[i]:=random(10,1);
write(a[i],' ');
if a[i] mod 2=0 then
a[i]:=2*a[i]
else
a[i]:=3*a[i];
end;
write(#13#10);
for i:=1 to n do
write(a[i],' ');
end.