0
返回的數組應包含輸入數組中具有最大總和的三個連續元素。我卡住了?有人幫忙嗎?我需要幫助返回最大數組的輸入
public class Assigment4 {
public static void main(String[] args) {
int [] setOfNum= {1,2,3,4};
}
public static int [] threeIntegers (int [] numbers){
int [] arrayNew = new int [numbers.length-1];
int sum=0;
for(int i=0; i<3;i++){
sum=sum+numbers[i];
}
if (sum>)//i got stuck here
}
}
感謝這幫助了很多! – Dee 2014-11-04 19:19:39