??????????????
import java.util.Scanner;
//?????
public class SplitBy2Sort {
public static int splitBy2(int[] a?? int num) {
int low = 0;
int high = a.length - 1;
int mid;
while (true) {
// ??м??±?
mid = (low + high) / 2;
if (a[mid] == num) {
return mid;
} else if (low > high) {
return -1;
} else if (num > a[mid]) {
low = mid + 1;
System.out.println("?±???????");
} else if (num < a[mid]) {
high = mid - 1;
System.out.println("?±???????");
}
}
}
public static void main(String[] args) {
int[] a = { 1?? 3?? 6?? 12?? 26?? 37?? 47?? 58?? 69?? 78?? 80?? 98?? 100?? 114?? 126??137?? 146?? 155?? 164?? 173 };
System.out.println("???????????");
for (int i = 0; i < a.length; i++)
System.out.print(a[i] + " ");
System.out.println();
System.out.println("???????????????");
Scanner s = new Scanner(System.in);
int num = s.nextInt();
int index = splitBy2(a?? num);
if (index != -1) {
System.out.println("?????±????" + index);
} else {
System.out.println("????????????");
}
}
}