O(n^2)这道题不能够直接排序,比如3和23,但是233比323大,所以采用两两组合再进行比较,字符串会自行按照字典序比较。var n,i,j,x:longint; s:array[0..233] of string;begin readln(n); for i:=1 to n do begin read(x); str(x,s[i]); end; for i:=1 to n-1 do for j:=i+1 to n do if s[i]+s[j]<s[j]+s[i] then begin s[0]:=s[i]; s[i]:=s[j]; s[j]:=s[0]; end; for i:=1 to n do write(s[i]);end.