📜  srand() c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:51.962000             🧑  作者: Mango

代码示例1
#include 
#include  //you need to include this so you can use time

srand(unsigned int(time(NULL))); 
// this will try to "randomize" the value according to the current time
// some compilers will treat it as a warning if you dont define it as unsigned