СВ
Сергей В
program cool;
var str:string;
index, i, count: integer;
begin
writeln('Введите строку: ');
readln(str);
writeln('Введите номер слова, в котором посчитать кол-во букв: ');
readln(index);
inc(index, -1);
for i:=1 to length(str) do
begin
if (str[i] = ' ') or (str[i] = '.') or (str[i] = ',') or (str[i] = '!') then inc(index, -1)
else if (index = 0) then inc(count);
end;
if (index <= 0) then writeln('Кол-во букв: ', count)
else writeln('Во введенной строке нет столько слов! ');
end.