var f : text;
s:string;
i,n,nah:integer;
begin
assign (f,'file.txt');
reset (f);
while not eof (f) do begin
n:=length(s);
nah:=1;
for i:=1 to n do begin
if (s[i+1]=' ' or i=n) then begin
if ((copy (s,i-3,4)='onok') or (copy(s,,i-3,4)='enok') then
writeln (copy(s,nah,i-nah+1));
if s[i+2]<>' ' then nah:=i+2;
end;
end;
readln;
end.
Программа выдает слова зак-ся на -онок, - енок. Что нужно переделать и как?