伪随机数

xiaoxiao2021-02-28  105

#include<stdio.h> #include <stdlib.h> #include <time.h> int main() { int seed = time(NULL);//给予种子 printf("seed: %d\n", seed); srand(seed); for (int i = 0; i < 10; i++) printf("%d \n", rand()); return 0; }
转载请注明原文地址: https://www.6miu.com/read-69567.html

最新回复(0)