/* 2015 * Maciej Szeptuch * II UWr */ #include <cstdio> int bills, bill, sum, min = 1024; int main(void) { scanf("%d", &bills); for(int b = 0; b < bills; ++ b) { scanf("%d", &bill); sum += bill; if(bill % 2 && bill < min) min = bill; } sum -= (sum % 2 ? min : 0); if(sum) printf("%d\n", sum); else puts("NIESTETY"); 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 25 26 27 28 29 30 | /* 2015 * Maciej Szeptuch * II UWr */ #include <cstdio> int bills, bill, sum, min = 1024; int main(void) { scanf("%d", &bills); for(int b = 0; b < bills; ++ b) { scanf("%d", &bill); sum += bill; if(bill % 2 && bill < min) min = bill; } sum -= (sum % 2 ? min : 0); if(sum) printf("%d\n", sum); else puts("NIESTETY"); return 0; } |