當前位置:編程學習大全網 - 編程軟體 - 排名字 pascal編寫

排名字 pascal編寫

program zjh;

var

a,st:array[0..9]of string;

c:array[0..9]of boolean;

i,j,n:longint;

str:string;

procedure try(t:longint);

var

i:longint;

begin

if t>n then begin{輸出}

for i:=1 to t-2 do

write(a[i],'-');

writeln(a[t-1]);

end;

for i:=1 to n do

if c[i] then{若這個名字沒用過,則就使用這個名字}

begin

c[i]:=false;

a[t]:=st[i];{將順序記錄下來}

try(t+1);

c[i]:=true;

end;

end;

begin

readln(n);

for i:=1 to n do

readln(st[i]);

for i:=1 to n-1 do

for j:=i+1 to n do {排序,為了字典序輸出}

if st[i]>st[j] then begin

str:=st[i];st[i]:=st[j];st[j]:=str;

end;

fillchar(c,sizeof(c),true);

try(1);{進入過程)

end.

  • 上一篇:造夢西遊3極品號源 造夢西遊3極品號源怎麽用
  • 下一篇:李峋為什麽叫朱韻公主
  • copyright 2024編程學習大全網