//代碼如下
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int buf[100];
//srand(time(0));
srand((unsigned)time(NULL));
for (int i = 0; i < 100; i++)
{
buf[i] = rand() % 100;
int j;
for (j = 0; j < i; j++)
{
if (buf[i] == buf[j])
{
buf[i] = rand() % 100;
j=-1;
}
}
}
for (int i = 0; i < 100; i++)
{
if (i % 10 == 0)
printf("\n");
printf("%2d ", buf[i]);
}
printf("\n");
system("pause");
return 1;
}