随机数种子

time_t ts;
unsigned int data = time(&ts);
srand(data);//创建随机数种子
int a[5] ;
for (int i = 0; i < 5; i++)
{
a[i] = rand()%100;
}

原文地址:https://www.cnblogs.com/sirwang/p/5479236.html