Skip to content

Commit 74594f1

Browse files
Merge pull request encrypted-def#61 from pha-ran/master
Update 2576.cpp
2 parents c36c790 + db9dbaf commit 74594f1

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

0x02/solutions/2576.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : pha-ran (soft18)
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/c2a05cf9d222441dba79bba4e9ac5b6e
44
#include <bits/stdc++.h>
55
using namespace std;
66

77
int main(void){
88
ios::sync_with_stdio(0);
99
cin.tie(0);
1010

11+
int x, odd = 0, sum = 0, min = 100;
12+
13+
for (int i = 0; i < 7; i++) {
14+
cin >> x;
15+
16+
if (x & 1) {
17+
odd += 1;
18+
sum += x;
19+
20+
if (x < min) {
21+
min = x;
22+
}
23+
}
24+
}
25+
26+
if (odd) cout << sum << "\n" << min;
27+
else cout << "-1";
1128
}

0 commit comments

Comments
 (0)