Var i,j:integer;
mas:array [1..10] of integer;
begin
randomize;
for i:= 1 to 10 do
mas[i]:=random(101);
for j:=1 to 10-1 do
for i:=1 to 10-j do
if mas[i] mod 10 > mas[i+1] mod 10 then
swap(mas[i],mas[i+1]);
for i:=1 to 10 do
writeln(mas[i]);
end.
2)
var a:array[1..10] of Integer;
i,j:Integer;
begin
randomize;
for i:=1 to 10 do
a[ i]:=random(101);
for i:=1 to 4 do
for j:=i+1 to 5 do
if a[ i] > a[ j] then
swap(a[i],a[j]);
for i:=5 to 9 do
for j:=i+1 to 10 do
if a[ i] < a[ j] then
swap(a[i],a[j]);;
for i:=1 to 10 do
write(a[ i],' ');
end.