怎样用c语言产生不同的随机数

2025-02-23 17:45:16
推荐回答(1个)
回答1:

先设置种子数srand((unsigned
int)time(0)).然后用rand()%100就可以产生0-100的不同随机数了,当然要包括头文件stdlib.h和time.h.