#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; }