C语言生成100%不相同的随机数
C语言生成100%不相同的随机数
日期:2021-07-19 09:14:56 人气:1
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int newNum(int a, int b, int *num)
{
int n = (int)((double)rand() / ((double)RAND_MAX + 1) * (b - a)) + a + 1;
for(int i = 0; i < b - a;
#include <stdlib.h>
#include <time.h>
int newNum(int a, int b, int *num)
{
int n = (int)((double)rand() / ((double)RAND_MAX + 1) * (b - a)) + a + 1;
for(int i = 0; i < b - a;