用链表与循环完成约瑟夫问题 while (cin>>x>>y) { node *p, *q; //建立循环链表 for (i = 1; i head = new node; list->head->data = i; q = list->head; continue; } p = new node; p->data = i; q->next = p; q = q->next; } q->next = list->head; c = x; p = list->head; q = p; list->count = 1;