-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest37.java
More file actions
28 lines (24 loc) · 767 Bytes
/
Copy pathTest37.java
File metadata and controls
28 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package programmers;
import java.util.ArrayList;
public class Test37 {
public static void main(String[] args) {
int[] nums = {1, 2, 7, 6, 4};
ArrayList<Integer> sumList = new ArrayList<>();
for (int i = 0; i < nums.length; i++) {
for (int j = i + 1; j < nums.length; j++) {
for (int k = j + 1; k < nums.length; k++) {
sumList.add(nums[i] + nums[j] + nums[k]);
}
}
}
System.out.println(sumList);
int answer=0;
for (int i = 0; i < sumList.size(); i++) {
for(int j=1;j< sumList.get(i);j++){
if(sumList.get(i)%j==0){
}
}
}
System.out.println(answer);
}
}