PascalABC.
Помогите объединить 3 программы.
1. Program ssee;
var a:array [1..20] of integer;
i, k: integer;
begin
for i:= 1 to 20 do a[i]:= random(51)-25;
k:= 0;
for i:= 1 to 20 do
if a[i]<0 then k:=k+1;
writeln('Кол-во отриц.эл.: ', k);
for i:= 1 to 20 do write( a[i]:4);
end.
2. Program fd;
var a: array [1..20] of integer;
i: integer;
begin
for i:= 1 to 20 do a[i]:= random (51)-25;
for i:=1 to 20 do
if a[i] mod 3=0 then writeln ('Найден эл. A[', i, ']= ');
for i:=1 to 20 do write(a[i]:4);
end.
3. Program fd;
var a: array [1..20] of integer;
i: integer;
begin
for i:= 1 to 20 do a[i]:= random (51)-25;
for i:=1 to 20 do
if a[i] mod 3=0 then writeln ('Найден эл. A[', i, ']= ');
for i:=1 to 20 do write(a[i]:4);
end.
Answers & Comments
Program ssee;
var a:array [1..20] of integer;
i, k: integer;
begin
for i:= 1 to 20 do a[i]:= random(51)-25;
k:= 0;
for i:= 1 to 20 do
if a[i]<0 then k:=k+1;
writeln('Кол-во отриц.эл.: ', k);
for i:=1 to 20 do
if a[i] mod 3=0 then writeln ('Найден эл. A[', i, ']= ');
for i:=1 to 20 do write(a[i]:4);
end.