只给函数行么 用P的 自己翻译下
function find(k:longint):longint;
var
left,right,mid:longint;
begin
left:=1;right:=n;
while leftright do
begin
mid:=(left+right) div 2;
if a[mid]>k then left:=mid+1 else right:=mid;
end;
exit(left);
end;
只给函数行么 用P的 自己翻译下
function find(k:longint):longint;
var
left,right,mid:longint;
begin
left:=1;right:=n;
while leftright do
begin
mid:=(left+right) div 2;
if a[mid]>k then left:=mid+1 else right:=mid;
end;
exit(left);
end;