📜  shuffle 函数 in - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:44.632000             🧑  作者: Mango

代码示例1
#include 

void shuffle(int arr[], int size){
    srand(time(0));
    for (int i = 0; i < size; i++) {
        int j = rand() % size;
        int t = arr[i];
        arr[i] = arr[j];
        arr[j] = t;
    }
}