#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define MAX 45
int main(void)
{
int i;
int num[6];
srand(time(NULL));
num[0] = rand() % MAX + 1;
num[1] = rand() % MAX + 1;
num[2] = rand() % MAX + 1;
num[3] = rand() % MAX + 1;
num[4] = rand() % MAX + 1;
num[5] = rand() % MAX + 1;
for (i = 0; i < 6; i++) {
while (1) {
if (num[i+1] == num[i])
num[i] = rand() % MAX + 1;
else
break;
}
}
for (i = 0; i < 6; i++)
printf("%d ", num[i]);
printf("\n");
return 0;
}