class Test{
public void run(int[]args,int target){
int last=0;
int next=args.length;
int midd=-1;
if(args[0]>target||args[next-1]<target){
System.out.println("is not num!");
return;
}
while(midd!=0){
midd=(last+next)/2;
System.out.println(midd);
if(args[midd]==target){
System.out.println("args index="+midd);
break;
}else
if(args[midd]>target){
next=midd;
}else
if(args[midd]<target){
last=midd;
}
}
}
public static void main(String[]args){
int nums[]={1,2,3,4,5,6,7,8};
new Test().run(nums,Integer.parseInt(args[0]));
}
}