比赛 20130725暑期B班1测 评测结果 WAWWWWWWWW
题目名称 单词缩写 最终得分 10
用户昵称 英雄寞乌云然 运行时间 0.005 s
代码语言 Pascal 内存使用 0.17 MiB
提交时间 2012-07-18 10:26:07
显示代码纯文本
program fl;
var
a,b,c,d,n,l,t,l2,k,j:longint;
s,s2,s0,sx,sj:string;
h:char;
begin
assign(input,'abbreviation.in');
reset(input);
assign(output,'abbreviation.out');
rewrite(output);
read(n);  readln;
for a:=1 to n do
begin
read(s);readln; s:=s+' ';   sx:=s+' ';
l:=length(sx);
t:=1;                   s0:=s2;


  repeat
  begin
   while (h<>' ') do
   begin l2:=l2+1;  h:=s[l2];
   if s[l2]<>' ' then s2:=s2+s[l2];  end;

  if  (s2<>'for') and (s2<>'For') then
    if (s2<>'and') and (s2<>'And') then
     if (s2 <>'the') and (s2<>'The') then
      if length(s2)>2 then
      begin
      if (s2[1]>='A')  and (s2[1]<='Z')  then write(s2[1])
       else write(chr(ord(s2[1])-32));
      end;
      s:=sj;
      for b:=l2+1 to l do   s:=s+sx[b];
       l:=l-l2;   l2:=0;  s2:=sj;    sx:=s;  h:='a';

  end;
    until l=0;
  writeln;
end;
close(input);
close(output);
end.