#include"stdio.h"
#include"stdlib.h"
typedef struct Lnode
{
int data;
struct Lnode *next;
}Lnode,*LinkList;
Lnode* InitList(LinkList L)
{
L=(Lnode*)malloc(sizeof(Lnode));
L->next=NULL;
return L;
}
Lnode* CreatList(LinkList L,int n)
{
Lnode *q;
LinkList p;
int i;
q=L=(Lnode*)malloc(sizeof(Lnode));
for(i=1;i<n;i++)
{
p=(Lnode*)malloc(sizeof(Lnode));
q->data=i;
q->next=p;
q=p;
}
q->data=n;
q->next=L;
L=q;
return L;
}
void DeleteNode(LinkList L,int n,int last,int number)
{
int count=0;
int people_last=n;
while(people_last>last)
{
count=0;
while(count!=number-1)
{
L=L->next;
count++;
}
评论0