厚德载物peng.blog.chinaunix.net
chengxiaopeng
hello world.
全部博文(308)
汇编语言(0)
离散数学(1)
C语言趣味程序百(11)
C++程序设计(30)
串(1)
队列(2)
栈(2)
链式存储结构(1)
线性表(1)
Shell编程(4)
其它(13)
Linux环境下C编程(3)
网络编程(1)
贪心算法(1)
分治法(1)
穷举法(1)
算法练习(1)
妙趣横生的算法(57)
xiongwen
jys715
li117666
lijunlin
km康蒙92
zhaounix
59459763
yaogh
youlan87
分类: C/C++
2010-08-27 14:42:24
struct student *del(struct student *head,long num){ struct student *p1,*p2; if (head == NULL) { printf("list is NULL!\n"); return head; } p1 = head; while(num != p1->num && p1->next != NULL) { p2 = p1; p1 = p1->next; } if (num == p1->num) { if (p1 == head) { head = p1->next; } else { p2->next = p1->next; } printf("delete :%ld\n",num); n -= 1; } else { printf("%ld not been found!\n",num); } return head;}
上一篇:C程序设计-链表操作[11.1]
下一篇:C程序设计-链表元素插入[11.3]
登录 注册