#include<stdio.h>
int main()
{
int x,a[15]={100,90,80,70,60,58,65,60,22,33,66,55,20,10,6};
int left,right,mid,flag=0,x;
printf("请输入带查找的数:\n");
scanf("%d",&x);
left=0;
right=14;
while(left<=right)
{
mid=(left+right)/2;
if(x==a[mid])
{
flag=1;
break;
}
else if(x>a[mid])
{
right=mid-1;
}
else
{
left=mid+1;
}
}
if(flag==1)
{
printf("找到了,是第%d个数\n",mid+1);
}
else
{
printf("无此数!\n");
}
return 0;
}