查询一个数组里面是否包含重复值
function TForm.BinarySearch(a:array of Integer):Integer; var i,j,temp:Integer; begin Result:=-1; if Length(a)>0 then begin for i :=0 to Length(a)-1 do begin temp:=a[i]; for j :=i+1 to Length(a)-1 do begin if (temp = a[j]) and (a[j]>0) then begin Result:=temp; Break; end; end; end; end; end;