#include<iostream>
#define N 10
using namespace std;
int main()
{
int i,low=0,high=N-1,mid,k=-1,m;
int a[N]={-3,4,7,9,13,45,67,89,100,180};
cout <<"a数组中的数据如下:"<< endl;
for(i=0;i<N;i++)
{
cout<<a[i];
}
cout<<endl;
cout<<"Enter m="<<endl;
cin>>m;
while(low<=high)
{
mid=(low+high)/2;
if(m<a[mid])
{
high=mid-1;
}
else if(m>a[mid])
{
low=mid+1;
}
else
{
k=mid;
break;
}
}
if(k>0)
cout<<"m="<<m<<",index="<<k<<endl;
else
cout<<"Not be found!"<<endl;
return 0;
}