fork(4) download
  1. #include <algorithm>
  2. #include <functional>
  3. #include <iostream>
  4. #include <vector>
  5.  
  6. int main()
  7. {
  8. std::vector<bool> A = { 0,1,0,1 };
  9. std::vector<bool> B = { 0,0,1,1 };
  10.  
  11. auto count = std::inner_product(begin(A), end(A), begin(B), 0, std::plus<>(), std::equal_to<>());
  12.  
  13. std::cout << count << '\n';
  14. }
  15.  
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
2