C++生成随机数踩坑心得
文章目录一、函数结果随机,文件执行结果固定二、文件执行每次结果也随机1. 引入srand((int)time(NULL))2. srand((int)time(NULL))应该放到哪里?总结
一、函数结果随机,文件执行结果固定
生成文件anyRand.cpp
#include <iosteam>
#include <ctime>
using namespace std;
//@Function return random number in range [left, right]
原创
2021-10-18 15:58:44 ·
306 阅读 ·
0 评论