时间:2021-01-02 15:14:02 | 栏目:JAVA代码 | 点击:次
public static void main(String[] args) {
int a[] = { 1, 2, 3, 4, 5, 6,7,8,9,10 };
for (int i = 0; i < a.length; i++) {
System.out.print(a[i] + " ");
}
System.out.println();
int s = 10;
int index = halfSearch(a, s);
System.out.println(s + "在数组中的下标是 " + index);
}
}