int main()
{
int sz[16];
int i, j, count;
for(i = 1; i < 16; i++)
sz[i] = 1;
i = 1;
j = 1;
count = 0;
while(1)
{
if(i == 16) i = 1;
while(sz[i] == 0)
{
i++;
if(i == 16) i = 1;
}
if(j == 3)
{
sz[i] = 0;
j = 0;
count++;
printf("%d\t", i);
if(count == 14)
break;
}
j++;
i++;
}
for(i = 1; i < 16; i++)
{
if(sz[i] != 0)
{
printf("\nThe last one is %d\n", i);
break;
}
}
return 0;
}
|