uses
Crt;
const
N=10; {ðàçìåð ìàññèâà}
function F(x:LongInt):byte;
var
temp:string;
begin
Str(x,temp);
F:=Length(temp)
end;
var
a: array [1..N] of LongInt;
i,j,temp:LongInt;
begin
ClrScr;
for i:=1 to N do
begin
Write('a[',i,']:=');
ReadLn(a[i])
end;
WriteLn('Array: ');
for i:=1 to N do
Write(a[i],' ');
WriteLn;
for i:=1 to N-1 do
for j:=i+1 to N do
if F(a[i])>F(a[j]) then
begin
temp:=a[i];
a[i]:=a[j];
a[j]:=temp
end;
WriteLn('Result');
for i:=1 to N do
Write(a[i],' ');
ReadLn
end.