| 网站首页 | 业界新闻 | 群组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

问题点数：0  回复次数：0

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

typedef struct Node
{
int date;
struct Node * pNext;

}NODE,* PNODE;

PNODE create_list(void);//创建链表

int main(void)
{

return 0 ;
}
PNODE create_list()
{
int len;
int val;
int i;
{
printf("shibai\n");
exit(-1);
}
P1->pNext = NULL;

printf("请输入您需要生成的链表节点的个数: len = ");
scanf("%d", &len);

for(i = 0;i < len;++i)
{
printf("请输入第%d个节点的值",i+1);
scanf("%d",&val);
PNODE P2 =  (PNODE)malloc(sizeof(NODE));
{
printf("shibai\n");
exit(-1);
}
P2->date = val;
P1->pNext= P2;
P2->pNext = NULL;
P1 = P2;
}

}
{

while (NULL != p)
{
printf("%d  ", p->date);
p = p->pNext;
}
printf("\n");

return;
}
{
int i = 0;
while(i< pos-1 && NULL != p)
{
p = p->pNext;
i++;
}
if(i > pos-1 || p == NULL)
return false;

PNODE pnew =(PNODE)malloc(sizeof(NODE));
if(NULL == pnew)
{
printf("失败！\n");
exit(-1);
}
pnew->date = val;
PNODE q = p->pNext;
p->pNext = pnew;
pnew->pNext = q;

return true;

}
• 1
• 1/1页
• 1