1.random随机数产生,需要种子,下面以时间为种子示例:
#include <iostream> #include <string> #include <vector> #include <ctime> #include <boost/random.hpp> using namespace std; using namespace boost; int main() { mt19937 rng(time(0)); for (int i = 0;i < 100;++i) { cout << rng() << "-" <<endl; } return 0; }