#include<stdio.h>
#include<malloc.h>
typedef struct Node{
int data;
struct Node * pNext;
}NODE, * PNODE;
PNODE create_list(void);
int main()
{
PNODE pHead = NULL;
pHead = create_list();
return 0;
}
PNODE create_list(void)
{
int len, i, val;
scanf("%d", &len);
PNODE pHead = (PNODE)malloc(sizeof(NODE));
if (pHead == NULL)
{
printf("分配失败,程序终止!\n");
exit(-1);
}
PNODE pTail = pHead;
pTail->pNext = NULL;
for(i=0; i<len; i++)
{
scanf("%d", &val);
PNODE pNew = (PNODE)malloc(sizeof(NODE));
pNew->data = val;
pNew->pNext = NULL;
pTail->pNext = pNew;
pTail = pNew;
}
return pHead;
}