C的
int all=17,need=17,k=3;
int x=0,y=0,i=0,j=0;
int a[5001]={0};
while(1)
{
x=x%all+1;
if(a[x]==0)
{
i=(i+1)%k;
if(i==0)
{y=y+1;a[x]=1;}
}
if(y==need)break;
}
C的
int all=17,need=17,k=3;
int x=0,y=0,i=0,j=0;
int a[5001]={0};
while(1)
{
x=x%all+1;
if(a[x]==0)
{
i=(i+1)%k;
if(i==0)
{y=y+1;a[x]=1;}
}
if(y==need)break;
}