学生信息管理系统C++语言程序代码.docVIP

  • 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

文档评论(0)

1亿VIP精品文档

相关文档