{
int size=1000;
srand((unsigned)time(0));
for (int i = 0; i < size; i++) {
data[i] = i;
}
for (int i = size - 1; i > 0; i--) {
swap(data[i], data[rand() % i]);
}
}
c++重复造轮子之生成随机不重复数组
最新推荐文章于 2024-09-09 12:31:15 发布