我弄了很久才把报错调为零。
可是运行没反应阿。
麻烦各位帮忙看一下。
辛苦辛苦
#include <stdio.h>
#include <malloc.h>
struct intNode{
    int value;
    struct intNode *next;
};
int menu()
{
    int choice;
    do{
        printf("\n\n\n");
        printf("(1)创建一个新链表");
        printf("(2)向某链表插入一个新元\n");
        printf("(3)从某链表删除一个表元\n");
        printf("(4)输出某链表\n");
        printf("(5)将某链表排序,变成按表元值排序的有序链表\n");
        printf("(6)将某两个有序链表合并成一个链表\n");
        printf("(7)按某链表复制出一个新表\n");
        printf("(8)结束程序\n");
        printf("输入你的选择\n");
        scanf("%d",&choice);
        if(choice>=1&&choice<=8)
            return choice;
        printf("选择时出错!重新选择\n");
    }while(1);
}
struct intNode *searchDOLink(struct intNode *h,int key,struct intNode **pp)
{
    struct intNode *v=h,*u=NULL;
    while((v!=NULL)&&(v->value!=key)){
        u=v;
        v=v->next;
    }
    *pp=u;
    return v;
}
struct intNode *creat()
{
    struct intNode *head=NULL,*tail=NULL,*p;
    int n;
    printf("input data\n");
    while(scanf("%d",&n)>0){
        p=(struct intNode *)malloc(sizeof(struct intNode));
        p->value=n;
        p->next=NULL;
        if(head==NULL)head=tail=p;
        else tail=tail->next=p;
    }
    return head;
}
int rInserte(struct intNode **hpt,int key)
{
    struct intNode *u,*w,*p;
    if((u=searchDOLink(*hpt,key,&w))==NULL||u->value!=key){
        p=(struct intNode *)malloc(sizeof(struct intNode));
        p->value=key;
        p->next=u;
        if(w==NULL) *hpt=p;
        else w->next=p;
        return 1;
    }
    return 0;
}
struct intNode *sDelete(struct intNode**hpt,int key)
{
    struct intNode *u,*w;
    u=*hpt;
    while((u!=NULL)&&(u->value!=key)){
        w=u;u=u->next;
    }
    if(u!=NULL){
        if(u==*hpt)
            *hpt=u->next;
        else w->next=u->next;
        u->next=NULL;
    }
    return u;
}
void output(struct intNode *h)
{
    struct intNode *p=h;
    while(p!=NULL){
        printf("%d\t",p->value);
        p=p->next;
    }
    printf("\n");
}
void rank(struct intNode **hpt)
{
    struct intNode *p,*u,*t;
    p=*hpt;
    u=p->next;
    if(p->value>u->value){
        t=p->next;
        p->next=u->next;
        p=t;
        u->next=p;
    }
}
struct intNode *connect(struct intNode *h1,struct intNode *h2)
{
    struct intNode *ne,*t,*p;
    ne=t=NULL;
    while(h1||h2){
        p=(struct intNode *)malloc(sizeof(struct intNode));
        if(h2==NULL||h1!=NULL&&h1->value<h2->value){
            p->value=h1->value;h1=h1->next;
        }
        else {p->value=h2->value;h2=h2->next;
        }
        p->next=NULL;
        if(t==NULL) ne=t=p;
        else t=t->next=p;
    }
    return ne;
}
struct intNode *copy(struct intNode *hpt)
{
    struct intNode *q,*head=NULL,*tail=NULL;
    while(hpt!=NULL){
        q=(struct intNode*)malloc(sizeof(struct intNode));
        q->value=hpt->value;
        q->next=NULL;
        if(tail==NULL)head=tail=q;
        else tail=tail->next=q;
        hpt=hpt->next;
    }
    return head;
}
void main()
{
    int choice;
    int i=1;
    struct intNode *h1=NULL,*t1=NULL,*h2=NULL,*t2=NULL,*h3=NULL,*t3=NULL,*p;
    p=(struct intNode*)malloc(sizeof(struct intNode));
    p->value=9;
    p->next=NULL;
    h1=t1=p;
    p=(struct intNode*)malloc(sizeof(struct intNode));
    p->value=2;
    p->next=NULL;
    t1=t1->next=p;
    p=(struct intNode*)malloc(sizeof(struct intNode));
    p->value=5;
    p->next=NULL;
    t1=t1->next=p;
    while(i<6){
        p=(struct intNode*)malloc(sizeof(struct intNode));
        p->value=2*i-1;
        p->next=NULL;
        if(h2==NULL)h2=t2=p;
        else t2=t2->next=p;
    }
    i=1;
    while(i<6){
        p=(struct intNode*)malloc(sizeof(struct intNode));
        p->value=2*i;
        p->next=NULL;
        if(h3==NULL)h3=t3=p;
        else t3=t3->next=p;
    }
    while(1){
        choice=menu();
        switch(choice){
        case 1: output(creat());break;
        case 2: rInserte(&h1,4);output(h1);break;
        case 3: sDelete(&h1,3);break;
        case 4: output(h1);break;
        case 5: rank(&h1);output(h1);break;
        case 6: output(connect(h2,h3));break;
        case 7: output(copy(h1));break;
        case 8:return;
        }
    }
}
        
 

 
											





 
	     
											 
										
					
	 sorry!!
sorry!!