9.31
program z931;
uses crt;
var s: string;
Procedure DelSpaces (var s: string);
begin
while (s[1]=' ') and (length (s)>0) do
s:= copy(s,2, length(s)-1);
end;
Procedure words(s: string);
var slovo: string;
p, l: Integer;
Begin
clrscr;
s:= s+'';
delspaces(s);
while s<>'' do begin
slovo:= copy(s, 1, Pos(' ', s)-1);
Delete(s,1, length (slovo));
Repeat
l:=length(slovo);
p:=pos(slovo[l], slovo);
if p<>l then delete(slovo, p, 1);
until p=l;
write(slovo, '');
delspaces(s);
end;
end;
begin
writeln('vvedite tekct: ');
readln(s);
words(s);
END.