#include<bits/stdc++.h>#include<malloc.h>#defineNULL0#defineLENsizeof(structstudent)structlist1{int num;structlist1*next;};structlist1*creat(){structlist1*head,*p,*q;
head =(structlist1*)malloc(sizeof(structlist1));
p = head;while(1){
q =(structlist1*)malloc(sizeof(structlist1));scanf("%d",&q -> num);if(q->num ==0)break;else{
p -> next = q;
p = q;}}
p -> next =NULL;return head;}voidinsert1(structlist1*head,int m){structlist1*p,*q,*r;
p = head;
q = p -> next;
r =(structlist1*)malloc(sizeof(structlist1));
r -> num = m;while(q !=NULL){if(m > q -> num){
p = q;
q = q ->next;}elsebreak;}
p -> next = r;
r -> next = q;}voiddelete1(structlist1*head,int n){structlist1*p,*q;
p = head;
q = p ->next;while(q !=NULL){if(q -> num == n){
p -> next = q -> next;free(q);break;}else{
p = q;
q = q -> next ;}if(q ==NULL)printf("未找到元素");}}voidprint(structlist1*head){structlist1*p;
p = head -> next;while(p !=NULL){printf("%d",p -> num);
p = p ->next;}}intmain(){int m, n;structlist1*a,*b;
a =creat();print(a);scanf("%d",&m);insert1(a, m);print(a);scanf("%d",&n);delete1(a, n);print(a);}