随机数

#include<time.h>

time_t ts;//设置时间变量
srand((unsigned int)time(&ts));//设置时间的随机数种子

rand()%100;//随机数在0~99范围内

原文地址:https://www.cnblogs.com/xingxingye/p/14418085.html