C++ 随机数 一、代码 srand(time(NULL)); int a = rand(); //用a来接收随机数 二、用到的库与函数 不需要引入库 int rand(void);——返回0~32767的整数 void srand(unsigned int seed);———设置rand种子 #inlcude<time.h> time(NULL)————返回从197## 标题0年1月1日至今所经历的秒数