#include<stdio.h>
#include<malloc.h>
#define LEN sizeof(struct man)
#define NULL 0
struct man
{
int mum;
struct man *next;
};
struct man *creat(int n)
{
struct man *head,*p1,*p2;
if(n==0)
head=NULL;
if(n!=0)
{
head=p2=p1=(struct man *)malloc(LEN);
head->mum=1;
int i;
i=2;
do
{
p1=(struct man *)malloc(LEN);
p1->mum=i;
p2->next=p1;
p2=p1;
i++;
}while(i<n);
p2=p1;
p1=(struct man *)malloc(LEN);
p2->next=p1;
p2->mum=n-1;
p1->next=head;
p1->mum=n;
}
return(head);
}
void ysf(int n,int s,int d,struct man *head)
{
struct man *p1,*p2,*p3;
p2=p1=head;
int m;
fl
c语言 约瑟夫死亡游戏 简单链表
最新推荐文章于 2023-04-07 15:43:06 发布