program prog;
uses crt;
var st : string;
i,j,k,count : integer;
begin
clrscr;
writeln('Vvedite text: ');
read(st);
write('koli4estvo simvolov=');
readln(count);
st := st+' ';
j := 0;
for i := 1 to length(st) do
if (st[i]<>' ') then inc(j) else
begin
if (j=count) then inc(k);
j := 0;
end;
writeln(st[]);
writeln(k,' slov s dlinoy=',count);
readln;
end.
Я думаю надо так
st1:=copy(st,pos(?) ,count);
writeln(st1);
Только не знаю как найти позицию слова, знаю только его длинну...
Сообщение отредактировано: Sav93 -