fork download
  1. #include <string>
  2.  
  3. template<typename T>
  4. void shuffle(T &array, size_t size) {
  5. for (int i = 0; i < size; ++i) {
  6. int index = i % size;
  7. std::swap(array[i], array[index]);
  8. }
  9. }
  10. int main() {}
  11.  
  12. //https://pt.stackoverflow.com/q/131138/101
Success #stdin #stdout 0s 4252KB
stdin
Standard input is empty
stdout
Standard output is empty