# 二.问题分析

``````#include<stdio.h>
#include<stdlib.h>

typedef struct Node
{
int id;
struct Node*next;
}Node;

Node* create_node(int x,int y)  //创建结点
{
Node*p = NULL;
p = (Node*)malloc(sizeof(Node));
p->id =x;
p->next = NULL;
return p;
}

Node * Create_List(int n)    //创建无头链表录入信息
{
Node *tail,*pnew;//创建一个新结点指针P和尾指针tail
for(int i=1;i<=n;i++)
{
printf("请输入第%d个人的密码",i);
{
tail = pnew;//尾指针指向第一个结点
}
else
{
tail->next = pnew;   //尾指针的下一个指向新的结点
tail = pnew;         //尾指针更新
}
}
printf("完成无头循环的建立");
}
{
{
printf("This list is empty!");
return 1;
}
return 0;
}

{

if(!IsEmptyList)
{
do
{
pmove = pmove->next;
}

}

{
int icounter = 0;  //作用为辅助for循环
int flag = 1;  //相当于Bool值，进行判断是否全部出队
Node * tail,*point,*temp;  //tail和point两个指针进行一前一后双指针删除操作
{
tail = tail->next;
}
while(flag)
{
{
tail = point;
point = point->next;
}
if(point == tail) flag = 0;       //两个指针重合，说明队为空
temp = point;                     //temp来记录要删除的结点
tail->next = point->next;         //进行删除操作
point= point->next;
free(temp);
}

}

int main()
{
int n = 0,m = 0;
printf("请输入人数：");
scanf("%d",&n);
printf("请输入初始密码:");
scanf("%d",&m);