记下备用
#include <iostream> #include <algorithm> #include <random> using namespace std; int main() { int a[] = {1, 2, 3, 4, 5, 6, 7, 8}; shuffle(begin(a), end(a), default_random_engine(random_device()())); for (const auto e : a) cout << e << ' '; cout << endl; return 0; }
本作品使用基于以下许可授权:Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.