记录编号 40634 评测结果 AAAAAAAAAA
题目名称 [暑假培训2012] 单词缩写 最终得分 100
用户昵称 Gravatarantenna 是否通过 通过
代码语言 Pascal 运行时间 0.004 s
提交时间 2012-07-18 15:09:38 内存使用 0.17 MiB
显示代码纯文本
var
t,i:longint;

function isalpha_s(a:char):boolean;begin
	if (a<='z') and (a>='a') then exit(true) else exit(false);
end;
function isalpha_b(a:char):boolean;begin
	if (a<='Z') and (a>='A') then exit(true) else exit(false);
end;
function isalpha(a:char):boolean;begin
	if isalpha_b(a) or isalpha_s(a) then exit(true) else exit(false);
end;
procedure upper(var a:string);
	var i:integer;begin
	for i:=1 to length(a) do
	if isalpha_s(a[i]) then a[i]:=chr(ord(a[i])-32);
end;
procedure work;
	var s,word:string;i:longint;begin
	readln(s);
	upper(s);
	s:=s+' ';
	i:=0;
	word:='';
	while i<length(s) do begin
	inc(i);
	if isalpha(s[i]) then word:=word+s[i] else begin
	if (word<>'THE') and (word<>'AND') and (word<>'FOR') and( length(word)>=3) then
	write(word[1]);
	word:='';
	end;
	end;
	writeln;
end;
begin
	assign(input,'abbreviation.in');reset(input);
	assign(output,'abbreviation.out');rewrite(output);
	readln(t);for i:=1 to t do work();
	close(input);close(output);
end.