fork(6) download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <vector>
  4.  
  5.  
  6. void print(const std::vector<bool>& v)
  7. {
  8. for (const auto& b : v) {
  9. std::cout << b;
  10. }
  11. std::cout << std::endl;
  12. }
  13.  
  14. int main()
  15. {
  16. std::vector<bool> v(8);
  17. v[2] = v[3] = true;
  18.  
  19. do {
  20. print(v);
  21. } while (std::next_permutation(begin(v), begin(v) + 4));
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
00110000
01010000
01100000
10010000
10100000
11000000