sdut2117数据结构实验之链表二:逆序建立链表
2016-11-06 15:06
211 查看
#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *next; }; int main() { int i,n; struct node *head,*p; head=(struct node*)malloc(sizeof(struct node)); head->next=NULL; scanf("%d",&n); for(i=0;i<n;i++) { p=(struct node*)malloc(sizeof(struct node)); scanf("%d",&p->data); p->next=head->next; head->next=p; } while(p) { printf("%d ",p->data); p=p->next; } return 0; } /*************************************************** User name: TJRAC6015203228魏杰 Result: Accepted Take time: 0ms Take Memory: 104KB Submit time: 2016-11-01 13:31:00 ****************************************************/
相关文章推荐
- SDUT2117数据结构实验之链表二:逆序建立链表
- 数据结构实验之链表二:逆序建立链表
- 逆序建立链表
- 基于链表:键盘输入若干个整数,按输入数据逆序建立一个带头结点的单链表
- 华为机试题(8)--单向链表的建立,反转(逆序),遍历显示,删除
- 数据结构实验之链表二:逆序建立链表
- SDUT OJ 数据结构实验之链表二:逆序建立链表
- 数据结构实验之链表二:逆序建立链表
- 数据结构实验之链表二:逆序建立链表
- 数据结构实验之链表二:逆序建立链表 (SDUT 2117)
- 单链表建立、插入、逆序
- 数据结构实验之链表二:逆序建立链表(附带链表的释放)
- 链表的建立、输出、逆序
- C语言 链表 数据结构实验之链表二:逆序建立链表
- 数据结构实验之链表二:逆序建立链表
- 2117数据结构实验之链表二:逆序建立链表
- 数据结构实验之链表二:逆序建立链表
- SDUT _2117 数据结构实验之链表二:逆序建立链表
- 逆序建立链表
- 数据结构实验之链表二:逆序建立链表