fork download
  1. #include <iostream>
  2. #include <bitset>
  3. #include <numeric>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. int main() {
  8. vector<bool> b{1,0,0,1};
  9. //bitset<4> b("1001");
  10. int arr[4] = {5,4,3,1};
  11. int test=inner_product(begin(arr), end(arr), b.begin(), 0);
  12. cout << test <<endl;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 4492KB
stdin
Standard input is empty
stdout
6