#include <ctime>
#include <thread>
int main()
{
std::srand((unsigned)time(NULL));
std::cout << time(NULL) << std::endl;
while (true)
{
int tmpvalue = rand() % 10000; //产生0-9999之间的随机数
std::cout << tmpvalue << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
c++ 从0到n-1的随机数
猜你喜欢
转载自blog.csdn.net/m0_37981386/article/details/107735514
今日推荐
周排行