#include <stdio.h>
typedef struct baoshu
{
int num,code;
struct baoshu *next;
}Node,*List;
void Quitbaoshu(List L,int n,int m)
{
Node *p,*s,*nL;
p=L->next;
printf("\n\nnishuruxinxiruxia:\n");
nL=L->next;
printf("\n\nchulieshunxu:\n");
do
{
int i=1;
p=nL;
while(i<m)
{
s=p;
p=p->next;
i++;
}
printf("xuesheng%d\n",p->num);
s->next=p->next;
nL=s->next;
n--;
}while(n>0);
free(p);
free(s);
}
void Creatbaoshu(List L,int n)
{
int i=1;
int key;
Node *p,*s;
p = L;
for(;i<=n;i++)
{ s=p;
p=(Node *)malloc(sizeof(Node));
s->next=p;
p->num=i;
}
p->next=L->next;
free(p);
}
void main()
{
int m,n;
List L;
L=(List)malloc(sizeof(Node));
printf("shu ru ren shu N he bao shu shang xian m:\n");
scanf("%d%d",&n,&m);
Creatbaoshu(L,n);
Quitbaoshu(L,n,m);
getch();
return;
}
程序就是上边这个 ,可以自己再加些东西