#include <iostream>
#include <algorithm>
using namespace std::placeholders;
bool is_divide_by(int n , int d) {
return n % d == 0;
}
int main() {
int arr[10] = {4, 45, 76, 12, 63, 98, 83273, 62, 23, 100};
int n = 3;
int count = std::count_if(arr, arr + sizeof(arr)/sizeof(int) , std::bind(&is_divide_by, _1, n));
// 45 12 63
std::cout << "total = " << count;
}
/*
run:
total = 3
*/