time_t ts; unsigned int data = time(&ts); srand(data);//创建随机数种子 int a[5] ; for (int i = 0; i < 5; i++) { a[i] = rand()%100; }