Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
#include
using namespace std; bool greater_than_5(int value) { return value > 5; } int main() { vector
numbers = {1, 7, 3, 5, 9, 2}; int amount = count_if(numbers.begin(), numbers.end(), greater_than_5); cout << "There are " << amount << " values greater than 5."; return 0; }
There are 2 values greater than 5.