const Alpha : set of char=['A'..'Z','А'..'П','Р'..'Я','a'..'z','а'..'п','р'..'я']; var s,t,luk:string; i,j:integer; found:boolean; begin writeln('Введите текст'); readln(s); writeln('Список слов в тексте:'); i:=length(s); luk:=''; Repeat while NOT(s[i] in Alpha) and (i>=1) do dec(i); t:=''; found:=false; while (s[i] in Alpha) and (i>=1) do begin t:=s[i]+t; if length(luk)<>0 then if Pos(s[i], luk) <> 0 then found:=true; dec(i); end; if not(found) and (length(luk)<>0) then writeln(t); if length(luk)=0 then luk := t; Until (i=0); readln; end. |