VC编程:数数游戏(帮我做一下,大一的水平,具体写详细点)
# include & ltstdio.h & gt
int main() {
int a[2000][2];
int i,j,n,cnt
scanf("%d ",& ampn);
for(I = 0;我& ltn;i++) {
a[I][0]= I+1;
a[I][1]= 1;
}
CNT = 0;
j = n;
while(j & gt;1) {
for(I = 0;我& lt4;i++) {
if(CNT & lt;n-1)cnt++;
else CNT = 0;
if(a[CNT][1]= = 0)I-;
}
a[CNT][1]= 0;
while(a[cnt][1] == 0) {
if(CNT & lt;n-1)cnt++;
else CNT = 0;
}
j-;
}
printf("remain:%d\n ",a[CNT][0]);
}