其他分享
首页 > 其他分享> > C语言,学生表的简单实现,涵盖单链表的创建,增,删,逆置等

C语言,学生表的简单实现,涵盖单链表的创建,增,删,逆置等

作者:互联网

后插法建立学生表,输出学生表,第x号学生的添加和删除,输出学生表的长度,删除指定年龄的学生信息

 

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Student{
	char id[20];
	char name[20];
	int age;
	struct Student *next;
}Stu;
//单链表的创建 (尾插法)
Stu *create(int n){
	Stu *head,*p,*tail;
	head=(Stu*)malloc(sizeof(Stu));
	head->next=NULL;
	tail=head;
	int i;
	printf("请输入需要添加学生的ID,名字,年龄&#x

标签:head,单链,int,学生,char,Stu,include,C语言,逆置
来源: https://blog.csdn.net/m0_53002692/article/details/120338340