c/c++随机数
<stdlib.h> int rand (void); //伪随机数 #include <stdio.h> #include <stdlib.h> int main(){ int a = rand(); printf("%d\n",a); return 0; } /////////////////////////////////////// //真随机数 void srand (unsigned int seed); #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int a; srand((unsigned)time(NULL)); a = rand(); printf("%d\n", a); return 0; }