
int Live(CircleList head) //返回存活的人的编号
{
int total = n;
int j = 1;
int count = 0;
Node* p = (Node*)malloc(sizeof(Node));
p = head;
for (j; j <= n; j++)
{
if (total <= 2)
{
break;
}
p = p->next;
count++;
int judge = count % 3;
if (judge) {
DeleteList(head, count); total--;
count = 0;
}
}
return p->data;
}
请问我这个实现约瑟夫环问题的代码哪里出错了啊?