- 笨笨的单词排序
- 2014-10-30 10:46:01 @
var
c:array[1..26] of char;
n,i,j:integer;
w:array[1..1000] of string;
p:0..1;
begin
for i:=1 to 26 do
read (c[i]);
readln;
readln(n);
for i:=1 to n do
readln(w[i]);
readln(p);
if p=1 then
begin
for i:=1 to 26 do
for j:=1 to n do
if w[j][1]=c[i] then writeln(w[j]);
end
else if p=0 then
begin
for i:=26 downto 1 do
for j:=1 to n do
if w[j][1]=c[i] then writeln(w[j]);
end;
end.
0 条评论
目前还没有评论...