需要头文件
#include <time.h>
#include <stdlib.h>
// 随机数种子
srand(time(0));
// 随机数
int a = 1 + rand()%100; // 产生1~100的随机数
需要头文件
#include <time.h>
#include <stdlib.h>
// 随机数种子
srand(time(0));
// 随机数
int a = 1 + rand()%100; // 产生1~100的随机数