我可以使用 STL 对 int* 数组进行排序, 像
一样简单明了std::sort(myarray, myarray + size);
有没有同样简单的随机化方法?
谢谢
最佳答案
std::random_shuffle
(myarray, myarray + size);
关于c++ - 使用STL随机化数组条目的简单方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2208411/