#include #include int main() { const std::vector input{4, -1, 0, 101, 7}; int total{0}; std::size_t accepted{0}; for (int count : input) { if (count < 0 || count > 100) { continue; } total += count; ++accepted; } std::cout << "Accepted: " << accepted << "; total: " << total << '\n'; }