Const n=10; var a:array[1..n]of integer; i,j,buf:integer; begin for i:=1 to n do begin a[i]:=random(100); write(a[i]:4); end; for i:=1 to n-1 do for j:=i+1 to n do if (a[i]mod 10+a[i]div 10)>(a[j]mod 10+a[j]div 10)then begin buf:=a[i]; a[i]:=a[j]; a[j]:=buf; end; writeln; writeln('NEW:'); for i:=1 to n do write(a[i]:4); end.
n=10;
var
a:array[1..n]of integer;
i,j,buf:integer;
begin
for i:=1 to n do
begin
a[i]:=random(100);
write(a[i]:4);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if (a[i]mod 10+a[i]div 10)>(a[j]mod 10+a[j]div 10)then
begin
buf:=a[i];
a[i]:=a[j];
a[j]:=buf;
end;
writeln;
writeln('NEW:');
for i:=1 to n do
write(a[i]:4);
end.