Из строки удалить пробелы и все согласные буквы удвоить — Pascal(Паскаль)

uses
  Crt;
const
  sg = ['b', 'c', 'd'];
var
  s: string;
  i: integer;
begin
  ClrScr;
  ReadLn(s);
  for i := Length(s) downto 1 do
    if s[i] in sg then
      Insert(s[i], s, i)
    else
      if s[i] = ' ' then
        Delete(s, i, 1);
  WriteLn(s);
  ReadLn;
end.

Leave a Comment

6 + 1 =