fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main(){
  7. vector<bool> test = { true, true, true, false,
  8. true, true, true, true,
  9. true, false, true, false,
  10. true, false, false, true,
  11. true, true, true, true,
  12. false, false, true, true };
  13.  
  14. unsigned int sum = accumulate(test.begin(), test.end(), 0u);
  15.  
  16. cout << sum << endl;
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
17