2 ms·
>Unfortunately, I often see solutions abusing exceptions: int sum = 0; for (int x : a) { try { sum += get_positive_value(x);
by ilyt 4y ago
>Unfortunately, I often see solutions abusing exceptions:
int sum = 0;
for (int x : a) {
try {
sum += get_positive_value(x);
} catch (...) {
sum += -x;
}
}
you need to fire whoever does that...