#include"stdio.h"
typedef struct node
{
int data[100];
int length;
}lnode;
int search(lnode L,int key,int low,int high)
{
int mid;
mid=(low+high)/2;
if(key==L.data[mid])
return(mid);
else
if(low==high)
return 0;
else
if(key>L.data[mid])
search(L,key,mid+1,high);
else
search(L,key,low,mid-1);
}
void main()
{
lnode L;
int i,m,frep;
printf("Input the number of the data:\n");
scanf("%d",&L.length);
for(i=1;i<=L.length;i++)
scanf("%d",&L.data[i]);
printf("Input the key to search:\n");
scanf("%d",&m);
frep=search(L,m,1,L.length);
if(frep==0)
printf("Not find the key!\n");
else
printf("The key is in the %d of the data!\n",frep);
}