⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.h

📁 学生信息管理的小程序 包括登记
💻 H
字号:
// LIST.h: 类的所有成员都在头文件里声明 
#include <iostream.h> 
#include <malloc.h> // 用到申请内存函数 malloc() 和释放内存函数 free() 
#include <string.h> // 字符串处理 
#include <stdio.h> // 文件操作 
#include <stdlib.h> // system("cls") 

struct telephone //联系方式 
{ 
	char phone[50]; //手机 
	char tel[30]; //家庭电话 
	char address[30];//家庭地址
}; 

struct person //个人信息 
{  
	char name[20]; //名字 
	char num[20]; //学号 
	char sex[10] ; //性别 
	char birthday[20]; //出生日期 
	char nation[10]; //民族 
	char clas[20]; //专业班级 
	char college[20]; //学院 
}; 

struct score //成绩 
{ 
	char english[20]; //英语
	char chiness[20]; //语文
	char math[20];    //数学
	char pe[20];      //体育
}; 

struct STUDENT
{
	struct person pe;
	struct score sc;
	struct telephone te;
};

//定义节点的类型 
typedef class linknode 
{ 
public: 
	struct STUDENT st; 
	bool flag; 
	class linknode* next; 
}nodetype; 

class LIST 
{ 
	nodetype* head; 
	
public: 
	LIST(); 
	LIST::~LIST(); 
	
	nodetype* Creatlist(int); //创建链表 
	int Listlen(); //返回链表长度 
	nodetype* FindNode(int); //通过查找序号返回节点的指针 
	nodetype* Find(char c[]); //通过查找姓名或学号返回节点的指针 
	int Find2(char c[]); //通过查找姓名或学号返回节点的序号 
	nodetype* InsNode(int); //插入节点 
	void DelNode(int); //删除节点 
	nodetype* Load(); //初始化:从外部读入数据 
	void Readstr(FILE *f,char *string); //读行函数 
	bool Check(char *a, char *b); //对比两个字符串是否相等 
	void EditPerson(nodetype*); //修改个人说明 
	void EditScore(nodetype*); //修改学科成绩 
	void EditScore2(nodetype*);//分项修改学科成绩
	void EditTelephone(nodetype*); //修改联系方式 
	void DispName(); //显示所有学生姓名 
	void DispNum();  //显示所有学生学号
	void DisAll();   //显示所有学生信息
	void DispNode(nodetype* p); //显示一个学生的所有信息 
	void DispPerson(nodetype*); //显示一个学生的个人说明 
	void DispScore(nodetype*); //显示一个学生的学科成绩
	void DispTelephone(nodetype*); //显示一个学生的联系方式 
}; 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -