#include <stdio.h>
int main(int argc,char const *argv[]){
int num[]={1,3,5,7,9};
int len=sizeof(num)/sizeof(num[0]);
for(int i=1;i<len;i++){
for(int j=0;j<i;j++){
if(num[i]>num[j]){
int temp=num[i];
for(int k=i-1;k>=j;k--){
num[k+1]=num[k];
}
num[j]=temp;
}
}
}
for(int i=0;i<len;i++){
printf("%d\n",num[i]);
}
int left=0,right=len-1;
int mid=(left+right)/2;
int k;
scanf("%d",&k);
while(left<=right){
mid=(left+right)/2;
if(k>num[mid]){
//因为数组从大到小,此处k>num[mid],right左移
right=mid-1;
}else if(k<num[mid]){
left=mid+1;
}else{
printf("%d",mid);
break;
}
}
if(left>right)
printf("没找到");
return 0;
}