收起
你的遍历数组有问题for(int i = 5;i <=8 ; i++){ sum += a[i];}System.out.println(sum);如果数组元素是键盘输入的话,前面加上Scanner,然后用for循环,添加数组元素就行
报告相同问题?