C++ 只能用C库的api来产生随机数. 头文件:#include <cstdlib> //参数随机数,数字范围为 0 ~ RAND_MAX 之间 int rand(); //在调用 rand 前调用,设置随机数种子 void srand(unsigned int seed);… 阅读全文