dele.c
来自「《C语言课程设计案例精编》源代码 希望对大家有所帮助」· C语言 代码 · 共 19 行
C
19 行
del(struct student*head,int n)
{struct student *p1,*p2;
long num;
if(head==NULL)
printf("\nlist NULL!\n");
p1=head;
printf("the information which need to clear up is num");
scanf("%ld",&num);
while(num!=p1->num&&p1->next!=NULL)
{p2=p1;p1=p1->next;};
if(num==p1->num)
{if(p1==head)head=p1->next;
printf("delete:%ld\n",num);
n=n-1;
}
else printf("%ld not been found!\n",num);
return(head);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?