We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c36c790 + db9dbaf commit 74594f1Copy full SHA for 74594f1
0x02/solutions/2576.cpp
@@ -1,11 +1,28 @@
1
-// Authored by : BaaaaaaaaaaarkingDog
+// Authored by : pha-ran (soft18)
2
// Co-authored by : -
3
-// http://boj.kr/****************
+// http://boj.kr/c2a05cf9d222441dba79bba4e9ac5b6e
4
#include <bits/stdc++.h>
5
using namespace std;
6
7
int main(void){
8
ios::sync_with_stdio(0);
9
cin.tie(0);
10
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";
28
}
0 commit comments