uses crt;
var
dl, ch, n: integer;
text, text1: string;
label 1;
begin
clrscr;
writeln('Введите текст');
readln(text);
ch := 1;
dl := length(text);
n := pos(' ', text);
1:
if n > 0 then
begin
ch := ch + 1;
Delete(text, 1, n);
dl := length(text);
if dl > 0 then
begin
n := pos(' ', text);
goto 1;
end;
end;
writeln('В предложениии ', ch, ' слов(о) ');
end.