2020-12-09
#include <stdio.h>
int zheban(int A[],int n,int k)
{
int low,high,mid;
low = 0;
high = n-1;
mid = (low + high)/2;
while(low<=high)
{
if(k<A[mid])
high = mid - 1;
else if(k>A[mid])
low = mid + 1;
else
return mid;
}
return -1;
}
int main()
{
i
原创
2020-12-09 12:03:00 ·
53 阅读 ·
0 评论