int i=0;
while(i
if(t == a[i]) {
return i;
} else {
i += Math.abs(t - a[i]);
}
}
return -1;
}
public static void main(String[] args) {
int[] a = {4,5,6,5,6,7,8,9,10,9};
System.out.println(find(a, 7));
}
招聘笔试题2018-11-22三水老师
int i=0;
while(i
if(t == a[i]) {
return i;
} else {
i += Math.abs(t - a[i]);
}
}
return -1;
}
public static void main(String[] args) {
int[] a = {4,5,6,5,6,7,8,9,10,9};
System.out.println(find(a, 7));
}
软件工程师笔试试题