int random=rand()%60即为0-59的范围
若rand()%60+40即为40-99的范围;但似乎是假随机,得用随机数种子。
再把random赋值给那个想要变成随机数的变量
先包含头文件#<ctime>
然后再main函数中种种子 srand((unsigned int)time(NULL));