#include <iostream>
#include <Windows.h>
#include <ctime> //包含 time(NULL) 的定义
using namespace std;
int main(void) {
srand((unsigned int)time(NULL)); //设置随机数“种子”
int random = rand() % 60;
cout << random << endl;
system("pause");
return 0;
}
创建真正的随机数
于 2024-03-21 18:08:29 首次发布