【C语言】随机数随机种子
时间:2020-09-05 23:20:49
收藏:0
阅读:65
#include "stdafx.h"
#include <stdlib.h>
#include <time.h>
int main() {
int a;
srand((unsigned)time(NULL)); //设置随机种子后 随机数会形成固定的序列
a = rand();
printf("%d\n", a);
getchar();
return 0;
}
原文:https://www.cnblogs.com/ganxiang/p/13619222.html
评论(0)