*#include <*stdio.h>
*#include<*stdlib.h>
#include<string.h>**
#define LEN sizeof(struct student)**
struct student
{
int num;
long int phone;
char name[20];
char sex[10];
struct student *next;
};
struct student *print(struct student *head)
{
struct student *p;
p = head;
do
{
printf(“num = %d , name = %s , sex = %s , phone = %d\n”,p -> num ,p -> name,p -> sex, p -> phone);
p = p -> next ;
}
while(p != NULL);
return NULL;
}
struct student *add(struct student *head)
{
struct student *p1,*p2,*p3;
int num,index;
char name[20];
char sex[10];
long int phone;
printf("请输入你想增加的序列号:");
scanf("%d",&index);
printf("请输入该同学的学号:");
scanf("%d",&num);
printf("请输入该同学的姓名:");
scanf("%s",name);
printf("请输入该同学的性别:");
scanf("%s",sex);
printf("请输入该同学的手机号码:");
scanf("%d",&phone);
if(head == NULL)
{
printf("The list is NULL");
}
else
{
p1 = p2 = head;
if(index == 1)
{
p3 = (struct student *)malloc(LEN);
p3 -> num = num;
strcpy(p3 -> name , name);
strcpy(p3 -> sex , sex);
p3 -> phone = phone;
head = p3;
p3 -> next = p1;
}
else
{
while(p1 -> next != NULL && p1 -> num +1 != index)
{
p1 = p1 -> next;
p2 = p1;
}
if(p1 -> num +1 == index)
{
p3 = (struct student *)malloc(LEN);
p3 -> num = num;
strcpy(p3 -> name , name);
strcpy(p3 -> sex , sex);
p3 -> phone = phone;
}
if(p2 -> next &