- 15
- 0
- 约1.21万字
- 约 14页
- 2018-09-25 发布于江西
- 举报
学生信息管理系统C++语言程序代码.doc
#include iostream.h
#include iomanip.h
#include fstream
#include vector
#include malloc.h
#include stdlib.h
#include string
#include process.h
#include stdio.h
#define LEN sizeof(struct student)
using namespace std;
int n=0; //定义一个全局变量统计学生人数
struct student//定义一个学生信息的结构体
{
char name[20]; //用来存放姓名的
char sex[20]; //用来存放性别的
char yuanxi[20];//用来存放院系的
long int id; //用来存放学号的
int score[4]; //用来存放分数的
int total; //用来存放总分数的
struct student *next;
};
vector student stu;
class Information
{
public:
Information() ; //构造函数.
~Information() ; //析构函数.
student *creat();//建立链表函数。
void output(student *head);
int count(student *head);//定义函数count()统计考生总数
student *insert(student*head);//指针函数*insert()用来添加考生信息.
student *cancel(student *head,long int num);//指针函数*cancel()用来删除考生信息.
student *find(student *head,long int num); //指针函数*find()用来查找考生信息.
void inorder(student *head);//定义inorder()函数将考生的总分从大到小排列并输出
void average( student *head);//求学生成绩的平均分的函数
void save(student *head);//保存函数
student *Read();//读取函数
private:
student *p1,*p2,*p3,*head,st;
};
Information::Information() //构造函数
{
cout ******************************************************************************\n;
cout ------------------------欢迎您使用学生信息管理系统------------------------\n;
cout ******************************************************************************\n\n;
}
Information::~Information() //构造函数
{
cout ******************************************************************************\n;
cout ------------------------谢谢您使用学生信息管理系统------------------------\n;
cout ******************************************************************************\n;
}
student *Information::creat(void) //定义一个指向struct student的结构体指针函数*creat()用来增加学生信息.
{
char ch[20];n=0; //用来存放姓名的
p1=p2=(student *)malloc(LEN);//调用malloc()函数用来开辟一个新的存储单元
cout -------------请建立学生考试信息表,在姓名处输入 ! 结束输入。--------------endl;
cout姓名:;
cinch;
head=NULL; //给指针head赋初值
while (strcmp(ch,!)!=0) //调用字符比较函数st
您可能关注的文档
最近下载
- 常州工业职业技术学院单招《数学》试题附答案详解(完整版).docx VIP
- 外圆磨说明书完整版_M1432B.pdf
- 人教版五年级数学下册 2 因数和倍数 第2课时 3的倍数(教学课件).pptx VIP
- 人教版八年级地理下册 (自然特征与农业)北方地区新课件教学用.pptx VIP
- 2025计算机二级《Python》真题解析.docx VIP
- 2025年高考俄语模拟试卷试题及答案完整版(含听力MP3原文).docx VIP
- 部编道德与法治六年级下册第4课《地球——我们的家园》优秀课件.pptx
- 《蛋白质纯化技术》课件.ppt VIP
- 2026年黑龙江农垦职业学院单招职业技能考试题库完整版.docx VIP
- 探秘白山黑水——东北地区的地理位置与自然环境深度探究.docx VIP
原创力文档

文档评论(0)