c++生成大整数随机数的方法
作者:互联网
int main() { int n; while (cin >> n) { std::mt19937_64 num((unsigned)time(NULL)); // 种子,可以选择时间作为seed std::uniform_int_distribution<uint64_t> distribution(1, 9999999999); // 设置范围 std::cout << distribution(num) << " ----- " << distribution(num) << std::endl; std::cout << distribution(num) << " ----- " << distribution(num) << std::endl; std::cout << distribution(num) << " ----- " << distribution(num) << std::endl; } system("pause"); return 0; }
标签:std,cout,int,整数,num,64,c++,随机数,distribution 来源: https://www.cnblogs.com/theda/p/15641985.html