fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. vector<int> a = {0, 0, 0, 0};
  8. vector<bool> b = {false, false, false, false};
  9.  
  10. for (auto now : a) {
  11. now = 1;
  12. }
  13.  
  14. for (auto now : b) {
  15. now = true;
  16. }
  17.  
  18. for (auto now : a) cout << now << " ";
  19. cout << endl;
  20. for (auto now : b) cout << now << " ";
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
0 0 0 0 
1 1 1 1