Кто в курсе как сделать?
uses
crt;
var
f:text;
px:^string;
st,s1^string;
flag^boolean;
k,d,maxd,ch:integer;
begin
clrscr;
assign<f, 'c:\tp70\bin\program.txt');
reset(f);
maxd:=1;
while not eof(f) do
begin
flag:=true;
new(px);
readln(f, px^);
while flag=true do begin
k:=pos(' ',px^);
if k<>0 then begin
st:=copy(px^,1,k);
delete(px^,1,k);
if lenght<st>maxd then begin
maxd:=lenght<st>;
s1:=st;
end;
flag:=true;
end;
if k=0 then begin
s:=copy<px^,1,lenght<px^>>;
if lenght<st>maxd then begin
maxd:=lenght<st>;
s1:st;
end;
flag:=false;
end;
end;
dispose<px>;
end;
close<f>;
reset<f>;
while not eof<f> do begin
new<px>;
readln<f,px^>;
k:=pos<s1,px^>;
if k<>0 then ch:ch+1;
dispose<px>;
end;
textcolor<2>;
writeln<'samoe dlinnoe slovo ',s1,' ego dlina ',maxd,' povtor ',ch>;
readln;
end.