【C语言】随机数随机种子

#include "stdafx.h"

#include <stdlib.h>
#include <time.h>
int main() {
    int a;
    srand((unsigned)time(NULL)); //设置随机种子后 随机数会形成固定的序列
    a = rand();
    printf("%d
", a);

    getchar();
    return 0;
}
原文地址:https://www.cnblogs.com/ganxiang/p/13619222.html