比赛 NOIP2015普及组练习 评测结果 WWWAWAAAAW
题目名称 字符串子串 最终得分 50
用户昵称 Ten.X 运行时间 0.010 s
代码语言 Pascal 内存使用 0.13 MiB
提交时间 2015-11-03 17:04:10
显示代码纯文本
var a:array[1..10]of string;answer:ansistring;
n,i:longint;
procedure qsort(s,t:longint);
var i,j:longint; q,m:string;
begin
i:=s; j:=t; m:=a[(s+t)div 2];
repeat
while a[i]<m do inc(i);
while a[j]>m do dec(j);
if i<=j then
begin
q:=a[i]; a[i]:=a[j]; a[j]:=q; inc(i); dec(j); end;
until i>j;
if s<j then qsort(s,j);
if i<t then qsort(i,t);
end;
begin
assign(input,'substring.in');
assign(output,'substring.out');
reset(input);
rewrite(output);
answer:='';
readln(n);
for i:=1 to n do
readln(a[i]);
qsort(1,n);
for i:=1 to n do 
answer:=answer+a[i];
write(answer);
close(input);
close(output);
end.