记录编号 40956 评测结果 AAAAAAAAAA
题目名称 [暑假培训2012] 单词缩写 最终得分 100
用户昵称 Gravatar英雄寞乌云然 是否通过 通过
代码语言 Pascal 运行时间 0.005 s
提交时间 2012-07-19 18:15:11 内存使用 0.17 MiB
显示代码纯文本
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
   begin
   if (s[l2]>='a') and (s[l2]<='z') then s[l2]:=chr(ord(s[l2])-32);
      s2:=s2+s[l2];
      end; end;



      if (s2<>'FOR') and (s2<>'AND') then
      if (s2<>'THE') and (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.