请问 srand((unsigned)time(0));这句是什么意思啊?time(0);代表什么意思啊?

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/02 02:29:45

请问 srand((unsigned)time(0));这句是什么意思啊?time(0);代表什么意思啊?
请问 srand((unsigned)time(0));这句是什么意思啊?time(0);代表什么意思啊?

请问 srand((unsigned)time(0));这句是什么意思啊?time(0);代表什么意思啊?
srand是产生随机数的种子,是的调用rand()函数时,每次产生的随机数不一样;也就是说,如果不加上srand,那么rand()函数产生的随机数是一样的