Дана S — строка символов длиной n. Заменить в этой строке каждую группу букв child группой букв children — Pascal(Паскаль)

var
s:string;
i:integer;
begin
readln(s);
for i:=length(s)-4 downto 1 do
if copy(s,i,5)='child' then insert ('ren',s,i+5);
writeln(s);
readln;
end.

Leave a Comment

+ 26 = 30