单链表的基本操作#includestdio.h#includestdlib.htypedefchardate;typedefstructnode{datech;structnode*next;}list;typedeflist*linklist;linklistcreat(){datech;linklisthead=(linklist)malloc(sizeof(list));list*p,*r;r=head;ch=getchar();while(ch!='\n'){p=(linklist)malloc(sizeof(list));p-ch=ch;r-next=p;r=p;ch=getchar();}r-next=NULL;return(head);}voidinsert(linklisthead,inti,charx){intj=0;linklistr,p;p=head-next;while(p&&ji-1){p=p-next;j++;}if(!p||ji-1)exit(1);r=(linklist)malloc(sizeof(list));r-ch=x;r-next=p-next;p-next=r;}voidputer(linklistlinker){linklistp;p=linker-next;while(p!=NULL){printf(%c,p-ch);p=p-next;}}voiddelet(linklisthead,inti){intj=0;linklistr,p;p=head-next;while(p&&ji-1){p=p-next;j++;}if(!p||ji-1)exit(1);r=p-next;p-next=r-next;free(r);}intmain(){staticintq,k;charw;printf(请输入字符穿,并以ENTER键结束\n);linklisthead,p,linker=creat();puter(linker);printf(请输入插入位置和插入字母\n);scanf(%d%c,&q,&w);insert(linker,q,w);puter(linker);printf(\n请输入删除位置的序号:\n);scanf(%d,&k);delet(linker,k);puter(linker);printf(\n);return0;}