定義變量
a,st:array[0..9]的字符串;
c:數組[0..9]的布爾;
I,j,n:longint;
str:字符串;
過程try(t:longint);
定義變量
我:渴望;
開始
如果t & gt然後開始{輸出}
對於i:=1到t-2 do
寫(a[i],'-');
writeln(a[t-1]);
結束;
對於i:=1到n do
如果c[i]那麽{如果這個名字沒有被使用,使用這個名字}
開始
c[I]:= false;
a[t]:= ST[I];{記錄訂單}
試試(t+1);
c[I]:= true;
結束;
結束;
開始
readln(n);
對於i:=1到n do
readln(ST[I]);
對於i:=1到n-1 do
For j:=i+1到n do {排序,用於字典順序輸出}
如果ST[I]& gt;然後開始
str:= ST[I];ST[I]:= ST[j];ST[j]:= str;
結束;
fillchar(c,sizeof(c),true);
試試(1);{進入流程)
結束。