#include "stdio.h"
#include "time.h"
#include "stdlib.h"
#define N 9
#define M 20
void main()
{
int i,j=0;
int num[N];
printf("随机数是:");
srand((unsigned)time(0));
for (i=0;i<N;i++)
{
num[i]=rand()%M;
}
for (i=0;i<N;i++)
{
if(num[j]==num[i])
{
num[j]=rand()%M;
}
j++;
}
for (i=0;i<N;i++)
{
printf ("%d\t",num[i]);
}
printf ("\n");
}
还是不会......555555......