使用random_shuffle生成随机序列,发现每次生成的都一样

看了下实现,里面用到了rand(), 想应该是随机种子的问题

加上 srand(static_cast<unsigned int>(time(0)));

OK

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-08
  • 2022-02-02
  • 2022-12-23
  • 2021-07-26
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案