相关代码 |
|
procedure LOCATE(XX:array of real; N:integer; X:real; var J:integer); label 10; var JL,JU,JM:INTEGER; begin JL:=0; JU:=N + 1; 10: If JU - JL > 1 Then begin JM:=(JU + JL) Div 2; If (XX[N] > XX[1]) = (X > XX[JM]) Then JL:=JM Else JU:=JM; GoTo 10; end; J:=JL; end;