键盘输入10个数,存到数组中,打印奇数位元素的值,// 注意:如果数组是{10,11,12,13,14,15},则奇数位元素是10,12,14
System.out.println("请输入10个数");
Scanner sc=new Scanner(System.in);
int[] b=new int[10];
for (int i = 0; i <b.length; i++) {
b[i]=sc.nextInt();
}
for (int i = 0; i <b.length; i=i+2) {
System.out.print("奇数位元素是: " + b[i]);
}