一、rand随机函数的使用
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
//随机洗牌程序
int main()
{
int i = 0;
int arr[54] = { 0 };
int mark[55] = { 0 };
srand((unsigned int)time(NULL));
while (i < 54) {
int x = rand() % 54 + 1;
if (mark[x] == 1) {
continue;
}
arr[i] = x;
mark[x] = 1;
printf("%d\t", arr[i]);
i++;
}
return 0;
}#include <stdio.h>
#include <tim