#include <stdio.h>
#include <stdlib.h>
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
void List_tail_insert(LinkList &L){
L=(LinkList)malloc(sizeof(LNode));
int x;
LNode *s,*r=L;
scanf("%d",&x);
while(x!=9999){
s=(LinkList)malloc(sizeof(LNode));
s->data=x;
r->next=s;
r=s;
scanf("%d",&x);
}
r->next=NULL;
}
void List_print(LinkList L){
L=L->next;
while(L!=NULL){
printf("%d\n",L->data);
L=L->next;
}
}
int main() {
LinkList L;
List_tail_insert(L);
List_print(L);
return 0;
}
01-05
3203
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-25
5658
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-04
3563
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交