#include<stdio.h>
#include<time.h>
int main()
{
int num[4];int i=0;int idx;
printf("Press any key to continue...\n");
srand((unsigned int)time(0));
do
{
i=0;
do
{
do
num[i]=rand()%10;
while(num[0]==0);
for(idx=i-1;idx>=0;idx--)
{
if(num[i]==num[idx])
break;
}
if(idx<0) i++;
}while(i<4);
printf("%d,%d,%d,%d\n",num[0],num[1],num[2],num[3]);
printf("To try it again?(y/n)\n");
}while(getch()=='y');
return 0;
}