#include<iostream>
#include<string>
#include<algorithm>
#include<ctime>
using namespace std;
const int INF = 1e9;
int main() {
//设置种子
srand((unsigned)time(NULL));
//可随机生成0-10以内的数
int t = rand() % 10;
cout << t << endl;
}
c++中生成随机数
发布时间 2023-09-20 12:33:26作者: BkDench