跳到正文

剪贴板

剪贴板 8prjk86v

原文
剪贴板信息

剪贴板信息

收录
更新
C++
#include <chrono>
#include <random>
std::mt19937 get_rand(std::chrono::system_clock::now().time_since_epoch().count());
std::mt19937_64 get_rand_64(std::chrono::system_clock::now().time_since_epoch().count());

这样直接写 get_rand() 就得到一个 unsigned int 范围内的随机数了

同理 get_rand_64() 就是 unsigned long long 范围内的随机数

C++11后食用