对time,srand,rand函数的一点看法(以及为什么两次rand函数调取的随机数会相同?)
首先看两段代码代码一:#include <stdio.h>#include <time.h>#include <stdlib.h>int main(){ int a = 0, b = 0, c = 0; srand((unsigned)time(NULL)); a = rand(); /*srand((unsigned)time(NULL));*/ b = rand(); c = rand(); printf(&