const rv: set of char = ['а', 'я', 'о', 'ё', 'у', 'ю', 'и', 'ы', 'е', 'э']; var s,w: string; c,cw: set of Char; i, p: integer; ch:char; begin c := rv; s:= 'Дана последовательность слов, разделенных пробелами, в конце концов точка.'; Writeln(s); while true do begin if Length(s) = 0 then break; while s[1]=' ' do Delete(s,1,1); i:=1; while true do begin if s[i]='.' then break; if s[i]=' ' then break; if i>Length(s) then break; inc(i); end; w:=Copy(S,1,i-1); Delete(S,1,i); if (w[1]='к') or (w[1]='К') then begin cw:=[]; for p:= 1 to i-1 do begin if w[p] in rv then Include(cw, w[p]); end; c:=c*cw; end; end; if c = [] then writeln('No vowels') else begin for ch:='а' to 'е' do if ch in c then Write(ch); if 'ё' in c then Write('ё'); for ch:='ж' to 'я' do if ch in c then Write(ch); writeln; end; end. |