发布网友 发布时间:2022-04-26 08:55
共3个回答
热心网友 时间:2022-06-26 05:07
var f:ansistring;(没有说明有多长,用超长字符串)热心网友 时间:2022-06-26 05:07
program add_ing;
var engword:string;
{实际上,超过32个字符的英语单词,都很罕见,100的个绝对没有,string 足够了}
fin,fout:text;
n:integer;
ct,cpt:char;
begin
assign(fin,'ing.in');reset(fin);
assign(fout,'ing.out');rewrite(fout);
repeat {while not eof(fin) do begin }
readln(fin,engword);n:=length(engword);
writeln(engword,'len =',n);
if(n>2)then begin
ct:=engword[n];
case ct of
'e':{e 结尾}
begin
cpt:= engword[n-1];
case cpt of
'a','e','i','o','u':{元音+e,直接+ing}
engword:=engword+'ing';
else begin {辅音+e,去掉e,+ing}
engword[n]:='i'; engword:=engword+'ng' ;
end;
end;
end;
'a','i','o','u':{元音结尾,直接+ing}
engword:=engword+'ing';
else begin {fu音结尾}
cpt:= engword[n-1];
case cpt of
'a','e','i','o','u':{元音+辅音,双写辅音+ing}
begin
engword:=engword+ct ;
engword:=engword+'ing';
end;
else begin {辅音+辅音,直接+ing}
engword:=engword+'ing';
end;
end;
end;
end;
writeln(fout,engword);
end;
writeln(engword);
until eof(fin);{end;}
close(fin);close(fout);
end.
运行结果:
热心网友 时间:2022-06-26 05:08
readln(word); // 输入后回车