A story a story is a book written and is ilustrated, bla lbablbalbalbalbla. Haley blflflflfllflfllflfllf. storystorystor.
program Project1;
var
S, Sw : String;
i, j, Len1, Len2, Cnt : Integer;
begin
repeat
Writeln('Задайте строку:');
Readln(S);
Writeln('Задайте искомую подстроку:');
Readln(Sw);
Len1 := Length(S);
Len2 := Length(Sw);
Cnt := 0;
for i := 1 to Len1 - Len2 + 1 do begin
j := 1;
while j <= Len2 do begin
if S[i + j - 1] <> Sw[j] then Break;
Inc(j);
end;
if j > Len2 then Inc(Cnt);
end;
Writeln('Количество вхождений: ', Cnt);
Writeln('Повторить - Enter. Выход - любой символ + Enter.');
Readln(S);
until S <> '';
end.