fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int main()
  5. {
  6. {
  7. vector <bool> d(42);
  8. for (bool &&e : d) e = false;
  9. for (bool b : d) cout << b;
  10. cout << '\n';
  11. }
  12. {
  13. vector <bool> d(42);
  14. for (bool &&e : d) e = true;
  15. for (bool b : d) cout << b;
  16. cout << '\n';
  17. }
  18. {
  19. vector <bool> d(42);
  20. for (auto &&e : d) e = false;
  21. for (bool b : d) cout << b;
  22. cout << '\n';
  23. }
  24. {
  25. vector <bool> d(42);
  26. for (auto &&e : d) e = true;
  27. for (bool b : d) cout << b;
  28. cout << '\n';
  29. }
  30. {
  31. vector <bool> d(42);
  32. for (vector<bool>::reference &&e : d) e = true;
  33. for (bool b : d) cout << b;
  34. cout << '\n';
  35. }
  36. }
Success #stdin #stdout 0.01s 5436KB
stdin
Standard input is empty
stdout
000000000000000000000000000000000000000000
000000000000000000000000000000000000000000
000000000000000000000000000000000000000000
111111111111111111111111111111111111111111
111111111111111111111111111111111111111111