#include
int main()
{
int a[6];
int i,c;
int low=0;
int high=5;
int mid;
for(i=0;i
scanf("%d",&a[i]);
scanf("%d",c);
for(i=0;i
{
mid=(high+low)/2;
if(c==a[mid])
printf("%d",mid);
if(c>a[mid])
low=mid+1;
if(c<a[mid])
high=mid-1;
}
if(c!=a[mid])
printf("sorry");
}
若找到输出:数所在的下标,否则输出sorry
如何修改