Ответ:
var
arr: array[1..10] of integer;
i, k, j: integer;
begin
randomize;
writeln('Массив: ');
for i := 1 to 10 do arr[i] := random(10,99);
for i := 1 to 10 do
for k := 1 to 9 do
if (arr[k] mod 10) > (arr[k + 1] mod 10) then begin
j := arr[k];
arr[k] := arr[k + 1];
arr[k + 1] := j;
end;
for i := 1 to 10 do write(arr[i],' ');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
var
arr: array[1..10] of integer;
i, k, j: integer;
begin
randomize;
writeln('Массив: ');
for i := 1 to 10 do arr[i] := random(10,99);
for i := 1 to 10 do
for k := 1 to 9 do
if (arr[k] mod 10) > (arr[k + 1] mod 10) then begin
j := arr[k];
arr[k] := arr[k + 1];
arr[k + 1] := j;
end;
for i := 1 to 10 do write(arr[i],' ');
end.