比赛 20130725暑期B班1测 评测结果 AAWAWAWWWW
题目名称 单词缩写 最终得分 40
用户昵称 李振文 运行时间 0.003 s
代码语言 Pascal 内存使用 0.17 MiB
提交时间 2012-07-18 11:25:46
显示代码纯文本
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.