var s:string;
i:integer;
begin
write ('Введите строку: ');
readln(s);
for i:=length(s) downto 1 do
if s[i]='а' then insert('а',s,i);
if s[i]='б' then insert('б',s,i);
if s[i]='А' then insert('А',s,i);
if s[i]='Б' then insert('Б',s,i);
end;
writeln(s);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var s:string;
i:integer;
begin
write ('Введите строку: ');
readln(s);
for i:=length(s) downto 1 do
begin
if s[i]='а' then insert('а',s,i);
if s[i]='б' then insert('б',s,i);
if s[i]='А' then insert('А',s,i);
if s[i]='Б' then insert('Б',s,i);
end;
writeln(s);
end.