continue
suggest changeJumps to the end of the smallest enclosing loop.
int sum = 0;
for (int i = 0; i < N; i++) {
int x;
std::cin >> x;
if (x < 0) continue;
sum += x;
// equivalent to: if (x >= 0) sum += x;
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents