#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
typedef int Elemtype;
typedef struct LNode{
int data;
struct LNode* next;
}LNode,*LinkList;
LinkList CreatList1(LinkList L){//头插
LNode* s;
L=(LinkList)malloc(sizeof(LNode));//创建头结点
int x;
L->next=NULL;
scanf("%d ",&x);
while(x!=9999){
s=(LNode*)malloc(sizeof(LNode));
s.data=x;
s->next=L->next;
L->next=s;
scanf("%d",&x);
}
return L;
}
int main(){
LinkList L;
LNode *p=CreatList1(L);
printf("\n");
while(p=p->next){
printf("%d ",p->data);
}
return 0;
}