uses newdelay,crt; const n=10; var seged,db,i,e,u:byte; x:array[1..n] of byte; begin randomize; for i:=1 to n do x[i]:=random(20)-10; e:=1; u:=n; seged:=x[e]; while e0) do inc(e); if e0 then db:=e else db:=e-1; end.