📅  最后修改于: 2022-03-11 14:52:08.699000             🧑  作者: Mango
MyMethod3
ArrayList sum = new ArrayList();
for (i = 0; i < MyArrayList.size(); i++){
for (j = i + 1; j < MyArrayList.size(); j++){
for (k = j + 1; k < MyArrayList.size(); k++){
int total = MyArrayList.get(i) + MyArrayList.get(j) + MyArrayList.get(k);
sum.add(total);
}
}
}
return sum;