// Authored by : pha-ran (soft18)
// Co-authored by : -
// http://boj.kr/c2a05cf9d222441dba79bba4e9ac5b6e
#include <bits/stdc++.h>
using namespace std;
int main(void){
ios::sync_with_stdio(0);
cin.tie(0);
int x, odd = 0, sum = 0, min = 100;
for (int i = 0; i < 7; i++) {
cin >> x;
if (x & 1) {
odd += 1;
sum += x;
if (x < min) {
min = x;
}
}
}
if (odd) cout << sum << "\n" << min;
else cout << "-1";
}
'CS(Computer Science)지식 > [C++][코딩 테스트] 자료구조 및 알고리즘' 카테고리의 다른 글
[C++] 백준 2309번 : 일곱 난쟁이 (0) | 2025.03.01 |
---|---|
[C++] 백준 2576번 : 홀수 (0) | 2025.02.23 |
[C++] 백준 2490번 : 윷놀이 (0) | 2025.02.22 |
[C++] 백준 10871번: X보다 작은 수 (0) | 2025.02.22 |
[C++] 백준 15312번: 이름 궁합 (1) | 2024.02.04 |