var a:array [1..10] of integer;
i,j:integer;
begin
for i:=1 to 10 do begin
a[i]:=2+random(49);
write(a[i],' ');
end;
for i:=1 to 9 do begin
for j:=1 to 10-i do
if a[j]>a[j+1] then
swap(a[j],a[j+1]);
writeln;
write(a[10]);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var a:array [1..10] of integer;
i,j:integer;
begin
for i:=1 to 10 do begin
a[i]:=2+random(49);
write(a[i],' ');
end;
for i:=1 to 9 do begin
for j:=1 to 10-i do
if a[j]>a[j+1] then
swap(a[j],a[j+1]);
end;
writeln;
for i:=1 to 10 do begin
write(a[i],' ');
end;
writeln;
write(a[10]);
end.