如果我进入98意味着它会显示6位。如何查找数组中某个特定数字的位置?
public class OddEven {
public static void main(String args[]) {
int[] numbers = new int[] { 14, 23, 67, 10, 76, 5, 98, 13, 110 };
for (int i = 0; i < numbers.length; i++) {
if(numbers[i]==14)
System.out.println(numbers[i]+"position 0");
else
System.out.println(numbers[i]+"no. not in the list");
}
}
}
请删除javascript标记。 –
那么,有什么问题? –
只是返回我,你会有位置 – cralfaro