二级C语言答案,新题库1.docVIP

  • 10
  • 0
  • 约11.99万字
  • 约 64页
  • 2016-10-07 发布于贵州
  • 举报
二级C语言答案,新题库1

第1套 1. 程序中,函数fun的功能是将不带头结点的单向链表逆置。即若原链表中从头至尾结点数据域依次为:2、4、6、8、10,逆置后,从头至尾结点数据域依次为:10、8、6、4、2。 #include stdio.h #include stdlib.h #define N 5 typedef struct node { int data; struct node *next; } NODE; /**********found**********/ __1__ fun(NODE *h) { NODE *p, *q, *r; p = h; if (p == NULL) return NULL; q = p-next; p-next = NULL; /**********found**********/ while (__2__) { r = q-next; q-next = p; p = q; /**********found**********/ q = __3__ ; } return p; } NODE *creatlist(int a[]) { NODE *h,*p,*q; int i; h=NULL; for(i=0; iN; i++)

文档评论(0)

1亿VIP精品文档

相关文档