#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> a = {1, 2, 3, 4, 5, 6};
mt19937 gen(random_device{}());
shuffle(a.begin(), a.end(), gen);
//打印
ostream_iterator<int> output(cout, " ");
copy(a.begin(), a.end(), output);
cout << endl;
}
c++洗牌方法shuffle
最新推荐文章于 2024-05-27 10:48:44 发布