#include <cstdio> int a, n, x; int mina = 9999; int main() { scanf("%d", &n); while (n--) { scanf("%d", &a); x += a; if ((a % 2 == 1) && (a < mina)) { mina = a; } } if (mina < 9999) { x -= mina; } if (x > 0) { printf("%d\n", x); } else { printf("NIESTETY\n"); } return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <cstdio> int a, n, x; int mina = 9999; int main() { scanf("%d", &n); while (n--) { scanf("%d", &a); x += a; if ((a % 2 == 1) && (a < mina)) { mina = a; } } if (mina < 9999) { x -= mina; } if (x > 0) { printf("%d\n", x); } else { printf("NIESTETY\n"); } return 0; } |