i like you什么意思:怎么用C语言生成随机数?
来源:百度文库 编辑:高校问答 时间:2024/05/28 02:01:08
rand()前面还有一条重要的语句,如果不写,生成的就总是同一个数。那句我忘了。
srand((unsigned)time(NULL));
//srand 配置随机数种子
srand((unsigned)time(NULL));
//srand 配置随机数种子