Uses crt; type mas = array [1.. 8, 1.. 8] of integer; var M:mas;i,j,k:integer; a:array[1..28]of integer; begin randomize; for i:=1 to 8 do begin for j:=1 to 8 do begin M[i,j]:=random(190)-95; write(M[i,j]:4); end; writeln; end; for i:=1 to 8 do for j:=1 to 8 do if i>j then begin k:=k+1; a[k]:=m[i,j]; end; writeln; for i:=1 to 28 do write(a[i]:4); end.
Program arra; const m=20; var B: Array[1..m] Of Integer; i,j,k:integer; BEGIN randomize; for i:=1 to m do begin B[i]:= random(101); end;
write('Массив до сортировки: '); for i:=1 to m do begin write(B[i]); write(' '); end; writeln; for i := 1 to m-1 do for j := 1 to m-i do if B[j] < B[j+1] then begin k := B[j]; B[j] := B[j+1]; B[j+1] := k end; write('Массив после сортировки: '); for i:=1 to m do begin write(B[i]); write(' '); end; end.
type mas = array [1.. 8, 1.. 8] of integer;
var M:mas;i,j,k:integer;
a:array[1..28]of integer;
begin
randomize;
for i:=1 to 8 do
begin
for j:=1 to 8 do
begin
M[i,j]:=random(190)-95;
write(M[i,j]:4);
end;
writeln;
end;
for i:=1 to 8 do
for j:=1 to 8 do
if i>j then
begin
k:=k+1;
a[k]:=m[i,j];
end;
writeln;
for i:=1 to 28 do
write(a[i]:4);
end.
const m=20;
var
B: Array[1..m] Of Integer;
i,j,k:integer;
BEGIN
randomize;
for i:=1 to m do begin
B[i]:= random(101);
end;
write('Массив до сортировки: ');
for i:=1 to m do begin
write(B[i]);
write(' ');
end;
writeln;
for i := 1 to m-1 do
for j := 1 to m-i do
if B[j] < B[j+1] then begin
k := B[j];
B[j] := B[j+1];
B[j+1] := k
end;
write('Массив после сортировки: ');
for i:=1 to m do begin
write(B[i]);
write(' ');
end;
end.