xtc820 2014-07-24 17:34:49
点我顶贴
收藏
删除
var i,j,n:longint;
a:array[0..100] of longint;
b:array[0..100] of string;
m,t1,t2:string;
begin
readln(n);
for i:=1 to n do read(a[i]);
for i:=1 to n do str(a[i],b[i]);
for i:=1 to n do
for j:=1 to n do
if (b[i]>b[j]) then
begin
if (pos(b[j],b[i])<>0) then
begin
t1:=b[i]+b[j]; t2:=b[j]+b[i];
if (t1>t2) then begin m:=b[i]; b[i]:=b[j]; b[j]:=m;
end;
end
else begin m:=b[i]; b[i]:=b[j]; b[j]:=m; end;
end;
for i:=1 to n do write(b[i]);
end.