**
srand()
**
功能:初始化随机数发生器
用法:srand(unsigned int seed)
需要头文件:stdlib.h
返回值:void无返回值
rand() 产生的随机数在每次运行的时候都是与上一次相同的。若要不同, 用函数 srand() 初始化它。可以利用 srand((unsigned int)(time(NULL)) 的方法,产生不同的随机数种子,因为每一次运行程序的时间是不同的。
实例:
#include <iostream>
#include <stdlib.h>
#include <time.h>
int main()