#include <iostream>
#include <vector>
#include <algorithm> // std::move_backward
#include <random> // std::default_random_engine
#include <chrono> // std::chrono::system_clock
using namespace std;
bool Generate(vector<int>&h)
{
for (int i = 1; i < 50; ++i) {
h.push_back (i);
}
unsigned seed = chrono::system_clock::now ().time_since_epoch ().count ();
shuffle (host.begin (), h.end (), default_random_engine (seed));
return 1;
}
int main (int argc, char* argv[])
{
vector<int> h;
Generate(h);
for (int i=0;i<50;++i)
cout << h[i] << '\t';
return 0;
}
网友评论