fork(2) download
  1. #include <algorithm>
  2. #include <iostream>
  3.  
  4. int main() {
  5. int a[7] = {1, 2, 3, 4, 5, 6, 7};
  6.  
  7. srand(time(NULL));
  8. std::random_shuffle(std::begin(a), std::end(a));
  9.  
  10. for (int item : a) {
  11. std::cout << item << " ";
  12. }
  13. std::cout << std::endl;
  14. }
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
4 6 3 1 2 5 7