import java.io.*;
import java.util.*;
class Main {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int oddNumberSum = 0, minNumber = 100000;
int[] numArray = new int[7];
for (int i = 0; i < numArray.length; i++) {
numArray[i] = Integer.parseInt(br.readLine());
}
int count = 0;
for (int i = 0; i < numArray.length; i++) {
if (numArray[i] % 2 != 0) {
if (numArray[i] < minNumber) {
minNumber = numArray[i];
}
oddNumberSum += numArray[i];
} else {
count++;
}
}
if (count == numArray.length) {
System.out.println(-1);
} else {
System.out.println(oddNumberSum);
System.out.println(minNumber);
}
}
}
해결방법