记录编号 40559 评测结果 AAAAAAAAAA
题目名称 [暑假培训2012] 单词缩写 最终得分 100
用户昵称 Gravatar李振文 是否通过 通过
代码语言 Pascal 运行时间 0.003 s
提交时间 2012-07-18 12:40:12 内存使用 0.17 MiB
显示代码纯文本
program a1;
var
n,i,j,x:longint;  k:char;
s:string;
ss:string;
begin
assign(input,'abbreviation.in');
reset(input);
assign(output,'abbreviation.out');
rewrite(output);
readln(n);
for i:=1 to n do begin
readln(s);
for j:=1 to ord(s[0]) do  begin
if (s[j]=' ')or(j=1)then begin
if j=1 then x:=j else
x:=j+1;ss:='';
while (s[x]<>' ')and(x<=ord(s[0]))do begin
ss:=ss+s[x];inc(x);end;
if (ord(ss[0])>3)or((ord(ss[0])=3)and(ss<>'and')and(ss<>'AND')and(ss<>'And')
and(ss<>'ANd')and(ss<>'AnD')and(ss<>'aNd')and(ss<>'anD')and(ss<>'aND')
and(ss<>'for')
and(ss<>'FOR')and(ss<>'For')and(ss<>'FOr')and(ss<>'FoR')and(ss<>'fOR')
and(ss<>'foR')and(ss<>'fOR')and(ss<>'the')and(ss<>'THE')and(ss<>'The')
and(ss<>'THe')and(ss<>'ThE')and(ss<>'tHE')and(ss<>'thE')and(ss<>'tHe'))
then begin if('a'<=ss[1])and(ss[1]<='z')then
write(chr(ord(ss[1])-ord('a')+ord('A')))else write(ss[1]);end;end; end;
if i<>n then writeln;end;
close(input);
close(output);
end.