//定义一个函数 用来折半查找一个数在数组的位置
class zhebanArr
{
/*
public static int zheban(int[] arr,int key)
{
int max,min,mid;
max = arr.length-1;
min = 0;
mid = (min+max)/2;
public static void main(String[] args)
{
//int[] arr = new int[]{10,9,8,7,6,5,4,3,2,1};
int[] arr = new int[]{1,2,3,4,5,6,7,8,9,10};
int x=zheban(arr,8);//调用折半查找
System.out.println(x);//打印该数的角标
}
public static int zheban(int[] arr,int key)
{
int min=0,max=arr.length-1,mid;