2016年12月23日
摘要: 1 #include"head.h" 2 struct Student* del_same_ID(struct Student*p1, struct Student*p2) 3 { 4 struct Student *p0 = p1; 5 struct Student *head_a = p1; 6 struct Student *head_b = p2; ... 阅读全文
posted @ 2016-12-23 22:22 新爱代 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 1 #include "head.h" 2 struct Student *del_same_age(struct Student*head, int age) 3 { 4 struct Student *p, *pt; int find = 0; 5 p = pt = head; 6 while (p != NULL)//当循环到最后一个节点时 7 ... 阅读全文
posted @ 2016-12-23 22:22 新爱代 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 1 struct Student 2 { 3 char ID[N_ID]; 4 char name[N_name]; 5 struct Student *next; 6 }alist[LEN_A],blist[LEN_B]; 7 ////以上是结构体 8 //初始化 9 struct Student alist[LEN_A] = { {"101","Wa... 阅读全文
posted @ 2016-12-23 22:21 新爱代 阅读(618) 评论(0) 推荐(0) 编辑
摘要: #include"head.h" struct Student* insert(struct Student*ahead, struct Student*bhead) { struct Student *pa1, *pa2, *pb1, *pb2; pa1 = pa2 = ahead; pb1 = pb2 = bhead; if ((ahead != NULL)&... 阅读全文
posted @ 2016-12-23 22:20 新爱代 阅读(1224) 评论(0) 推荐(0) 编辑
摘要: #include"head.h" void print(struct Student* head) { struct Student *p; printf("There are %d records:\n", sum); p = head; if (p != NULL) { do { printf("... 阅读全文
posted @ 2016-12-23 22:19 新爱代 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 1 #include"head.h" 2 int main() 3 { 4 struct Student *head; 5 struct Student *addinfo; 6 printf("请输入信息(101 wang f s 501)(以“0 0 0 s 0”作为结束标志):\n"); 7 head = input(); 8 prin... 阅读全文
posted @ 2016-12-23 22:18 新爱代 阅读(573) 评论(0) 推荐(0) 编辑
摘要: 1 #include"head.h" 2 struct Student* insert(struct Student*head, struct Student*addinfo) 3 { 4 struct Student *p0, *p1, *p2; //开辟三个结构体指针 5 p2=p1 = head; //头指针赋给p1,p2 6 p0 = addin... 阅读全文
posted @ 2016-12-23 22:15 新爱代 阅读(733) 评论(0) 推荐(0) 编辑
摘要: 1 #include "head.h" 2 struct Student*del(struct Student*head,char num[N]) 3 { 4 struct Student*p1, *p2; 5 if (head == NULL) //若链表为空,则无需处理 6 { 7 printf("\nl... 阅读全文
posted @ 2016-12-23 22:13 新爱代 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 1 #include "head.h" 2 struct Student *creat() 3 { 4 struct Student *head, *p1, *p2;// 先开辟三个结构体指针,*head,(作为返回的头指针) 5 p1 = p2 =(struct Student *) malloc(LEN); 6 scanf_s("%s %f", p1->n... 阅读全文
posted @ 2016-12-23 22:12 新爱代 阅读(880) 评论(0) 推荐(0) 编辑
摘要: "fatal.h"//头文件 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define Error(Str) FatalError(Str) 4 #define FatalError(Str) fprintf(stderr,"%s\n",Str),exit 阅读全文
posted @ 2016-12-23 21:52 新爱代 阅读(2255) 评论(0) 推荐(0) 编辑