📄 delete.c
字号:
#include<stdio.h>
#include"def.h"
struct student * del(struct student * head, long num)
{
struct student *p1,*p2;
if(head==NULL)
{printf("\nList null!\n");goto end;}
p1=head;
while((num!=p1->num)&&(p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(num==p1->num)
{
if(p1==head)
head=p1->next;
else
p2->next=p1->next;
printf("\nthe value %ld was deleted!\n",num);
n=n-1;
}
else
printf("\nThe value %ld is not found!\n",num);
end:
return (head);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -