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 print(head); 9 char del_num[N]; 10 printf("请输入要删除的号码(输入0终止删除):"); 11 scanf_s("%s", del_num,N); 12 head = del(head,del_num); 13 print(head); 14 while (strcmp(del_num, "0") != 0) //用while 循环“0”为终止条件 15 { 16 printf("请输入要删除的号码(输入0终止删除):"); 17 scanf_s("%s", del_num, N); 18 head = del(head, del_num); 19 print(head); 20 } 21 22 printf("请输入要增加的信息(以“0 0 0 s 0”作为结束标志):\n"); 23 addinfo = input(); 24 while (addinfo != NULL) ////用while 循环“0”为终止条件 25 { 26 head = insert(head, addinfo); 27 print(head); 28 printf("请输入要增加的信息(以“0 0 0 s 0”作为结束标志):\n"); 29 addinfo = input(); 30 } 31 return 0; 32 }
时间: 2024-11-03 03:25:04