for (int i=0;i<max.length;i++){
System.out.print(max[i]);
if(max[i]>low ){
low = max[i];
if(low<=b){
soln=low;
}
}
}
System.out.println();
if(soln==0){
System.out.println(neg);
} else {
System.out.println(soln);
}
output 8
(输出8)
Well, I have given value of neg=-1,low=0, b=10, keyboards=2, drive=3 and my array is
(好吧,我给定了neg = -1,low = 0,b = 10,keyboards = 2,drive = 3的值,我的数组是)
[3 1]
([3 1])
[5 2 8]
([5 2 8])
I have added the keyboard and drive value stored it in max array.
(我已经添加了键盘并将驱动器值存储在max数组中。)
When I compare those max array values with b if(max[i]>low), it should return 9 after the completion of loop. (当我将这些最大数组值与b if(max [i]> low)比较时,它应在循环完成后返回9。)
But it is taking only first element in the max array. (但是它只占用max数组中的第一个元素。)
I don't know why? (不知道为什么)
Please help me. (请帮我。)
ask by von translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…