Kone - Zadanie 23

program zadanie26; Uses CRT; Var i,n,ab,c,d,p,max,j:integer; nazov: array[1..100] of string; l,z:array [1..100] of integer; Begin ClrScr; WriteLn('Kolko filmov chces zadat?'); ReadLn(n); WriteLn('Zadaj nazvy filmov.'); for i:=1 to n do begin ReadLn(nazov[i]); end; for i:=1 to n do begin d:=0; d:=pos('kone',nazov[i]); if d<>0 then WriteLn(nazov[i]); end; for i:=1 to n do l[i]:= length (nazov[i]); for i:=1 to n do        BEGIN max:=0; for j:=1 to n do                BEGIN if l[i]>max then BEGIN p:=i; max:=l[i]; END; END; l[p]:=0; z[i]:=p; END; for i:=1 to n do writeln (nazov[z[i]]); ReadLn; End.