#include<stdio.h>
#include<stdlib.h>
typedef struct Node
{
int age;
struct Node *next;
}List;
List *creatSinglyLinkedList(int n)
{
List *head,*p,*r;
head=(List*)malloc(sizeof(List));
printf("请输入你要存储数据第1个数据:/n");
scanf("%d",&head->age);
head->next=NULL;
p=head;
for(int i=1;i<n-1;i++){
r=(List *)malloc(sizeof(List));
printf("请输入你要存储数据第%d个数据:/n",i+1);
scanf("%d",&r->age);
p->next=r;
p=r;
}
p->next=NULL;
return head;
}
void main(){
int i=4;
List *Head;
Head=creatSinglyLinkedList(i);
}