#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 7
void luck(int sourse[],int size,int times);
int main(void)
{
int soid[SIZE];
for(int i=0;i<SIZE;i++)
soid[i]=i;
luck(soid,SIZE,SIZE);
}
void luck(int sourse[],int size,int times)
{
int luck[times];
srand((unsigned int)time(NULL));
for(int i=0;i<times;i++)
{
luck[i]=rand() % size;
for(int m=0;m<i;m++)
{
if(luck[i]==luck[m])
i--;
}
}
for(int i=0;i<times;i++)
printf("第%d个是%d\n",luck[i],sourse[luck[i]]);
}