C++学生管理系统代码

合集下载

学生管理系统c语言源代码

学生管理系统c语言源代码

int main()
{
initLinkTable(&head);//初始化表头
readStu();//读入源文件
while (1)
{
menu();
system("cls");
}
}
void initLinkTable(studentLinkPoint *p)
int sum(studentLinkPoint);//求和
void avg(studentLinkPoint);//求平均分
void disAvgSum(studentLinkPoint);//显示总分和平均分
char *inputNumber();//专门用来输入一个学生的学号,返回该字符串的指针
char name[20];
char number[18];
int i;
if(temp==0)
{
error("input");
return 0;
}
else
{
temp->student=(studentPint)malloc(sizeof(studentNod));
break;
case 0:
del(head,end);
break;
}
if(c==0)
exit(1);
}
void del(studentLinkPoint p,studentLinkPoint End)
{
studentLinkPoint q;
if(end==head)
printf(" %3.1f %3.1f\n",p->student->sum,p->student->avg);

c语言学生管理系统源代码

c语言学生管理系统源代码

c语言学生管理系统源代码#include <stdio.h>。

#include <stdlib.h>。

#include <string.h>。

/*定义学生结构体*/。

typedef struct student。

char num[20]; //学号。

char name[20]; //姓名。

int c; //语文成绩。

int math; //数学成绩。

float ave; //平均分。

struct student *next;。

} stu;。

/*函数声明*/。

void menu_select(); //显示菜单。

void add(); //添加学生信息。

void delete(); //删除学生信息。

void modify(); //修改学生信息。

void search(); //查询学生信息。

void get_ave(); //计算学生平均成绩。

void display(); //显示学生信息。

void esc(); //退出系统。

int main()。

menu_select();。

return 0;。

}。

//显示菜单。

void menu_select()。

int select;。

while (1)。

printf("\n学生管理系统\n");。

printf("------菜单------\n");。

printf("1.添加学生信息 2.删除学生信息\n");。

printf("3.修改学生信息 4.查询学生信息\n");。

printf("5.计算学生平均成绩 6.显示学生信息\n");。

printf("7.退出系统\n");。

printf("请输入您的选择:");。

scanf("%d", &select);。

C语言学籍管理系统(内含源代码)

C语言学籍管理系统(内含源代码)

学籍管理系统一、系统简介设计一个基于结构体数组的学生学籍管理系统,能实现对学生学籍信息进行录入,修改,删除,查询和输出等基本操作二、需求分析学籍管理系统应该实现以下功能:1、能录入学生的基本信息,包括学号,姓名,专业,年级,性别和出生日期信息,保存到结构体数组中。

2、能根据输入的学号查询学生,进行信息的修改。

3、能根据输入的学号从结构体数组中删除学生的记录。

4、实现查询功能,能根据输入的学号或年级在屏幕上显示相应的学生信息。

5、能在屏幕上以列表的方式输出所有学生的信息。

三、概要设计1、系统功能根据项目的开发要求,本系统划分成六个主要功能模块:录入学生信息模块、修改学生信息模块、删除学生信息模块、查询学生信息模块、输出模块和推出模块。

系统功能机构图如下:2、重要数据的数据结构设计学生学籍的记录项用结构体Stu message表示,包括6个属性,stuno,name、spec、grade、sex、birthday 分另U代表学生的学号、专业、年级、性另U和出生日期,其中birthday 类型为自定义的结构体类型Date.Struct stumessage {Char stuno[11]: // 学号Char name[9]: // 姓名Char spec[2]: // 专业Char grade: // 年级Char sex : // 性别Stuct date birthday: // 出生日期};日期类型date包括三个属性,分别代表年、月、日Struct date{int year : // 年Int month: //Int day: // H};3、函数设计学籍管理系统程序采用了结构化程序设计的思想,由1个.h 头文件和3个C源文件组成。

程序中除了主函数外,共设计了以下14个函数,分别包含在3个.c源文件中。

以下是这些函数原型及功能设计。

(1) void sysinfo(void)函数功能:在屏幕上输入系统及信息并等待用户响应。

C语言课程设计学生成绩管理系统源代码吉林大学

C语言课程设计学生成绩管理系统源代码吉林大学

#include<stdio.h>#include<string.h>#include<stdlib.h>#include<time.h>typedef struct student{ /*定义结构体*/char IDNumber[16];/*学号*/char FamilyName[16]; /*姓*/char GivenName[16]; /*名*/int sex; /*性别(0代表“女”,1代表“男”)*/int BirthYear; /*出生年*/int BirthMonth; /*出生月*/int BirthDay; /*出生日*/float score[4]; /*成绩*/float sum; /*总分*/float average; /*平均分*/}stu;typedef struct Lnode{student data;Lnode *next;}st, *linklist;/***************************************************************************/ struct tm* ptm;float Sumstu(linklist L);float Averstu(linklist L);float Sumstu(linklist L){ /*计算总分*/linklist s;s=L;int i;s->data.sum=0;for(i=0;i<=4;i++){s->data.sum+=s->data.score[i];}return (s->data.sum);}float Averstu(linklist L){linklist q;q=L;Sumstu(q);q->data.average=q->data.sum/4;return (q->data.average);}void TimeNow() /*获取系统时间*/{struct tm* ptm;long ts;int y,m,d,h,n,s;ts = time(NULL);ptm = localtime(&ts);y = ptm-> tm_year+1900; //年m = ptm-> tm_mon+1; //月d = ptm-> tm_mday; //日h = ptm-> tm_hour; //时n = ptm-> tm_min; //分s = ptm-> tm_sec; //秒}int Menu() /*菜单函数*/{int n;printf("\t\t\t\n\n\n\n欢迎使用学生成绩管理系统\n\n\t\t\t按任意键进入系统!");system("pause");system("cls");printf("************************************************************************* *\n");printf("\n\t\t\t学生成绩管理系统\n\t\t\t\t制作人陈光林(52101407)\n");printf("-------------------------------菜单(Menu)---------------------------------\n");printf("\n\t 1. Enter list 输入记录\n");printf(" \t 2. Delete a record from list 删除记录\n");printf(" \t 3. Print list 显示所有记录\n");printf(" \t 4. Search record on name 按照姓名查找记录\n");printf(" \t 5. Save the file 保存记录到文件中\n");printf(" \t 6. Load the file 从文件中读入记录\n");printf(" \t 7. Compute the score 计算所有学生的总分和均分\n");printf(" \t 8. Query by class 按班级查询显示学生总分\n");printf(" \t 9. Insert record to list 插入记录到表中\n");printf(" \t 0. Quit 退出系统\n");printf("---------------------------------------------------------------------------\n");printf("************************************************************************* ***\n");do{printf("\n\t\t\t 请选择你需要的操作(0—9):");scanf("%d",&n);}while(n<1||n>5); /*如果选择项不在1—9之间则重输*/return(n); /*返回选择项*/}/***************************************************************************/linklist initlist(void) /*建立一个空链表*/{linklist L=(linklist)malloc(sizeof(st));L->next=NULL;return NULL;}/*建立学生信息链表*/st *creastlist(linklist L){int i;float s;linklist p;for(;;){p=(linklist)malloc(sizeof(st)); /*开辟新的节点*/if(!p){printf("\n Out of memory.");return (L);}printf("请输入学生学号");scanf("%s",p->data.IDNumber);if(p->data.IDNumber[0]=='0') break;printf("请输入姓:");scanf("%s",p->data.FamilyName);printf("请输入名:");scanf("%s",p->data.GivenName);printf("请输入性别(0女/1男):");scanf("%d",&p->data.sex);printf("请输入生日:");scanf("%d %d %d",&p->data.BirthYear, &p->data.BirthMonth,&p->data.BirthDay);printf("请输入成绩\n",4);s=0;for(i=0;i<4;i++){do{printf("score%d:",i+1);scanf("%f",&p->data.score[i]);if(p->data.score[i]<0 || p->data.score[i]>100)printf(" Data error,please enter again.\n");}while(p->data.score[i]<0 || p->data.score[i]>100);s=s+p->data.score[i];}p->data.sum=s;p->data.average=s/4;p->next=L;L=p;}return(L);}/****************************************************************************** *****************//*void creastlist(linklist L){st *p;linklist head=NULL;p=(linklist)malloc(sizeof(st));p=L;for(;;){printf("请输入学生学号:\n");scanf("%s",p->data.IDNumber);printf("请依次输入学生姓名:\n");scanf("%s%s",p->data.FamilyName,p->data.GivenName);printf("请输入出生年月日:\n");scanf("%d%d%d",p->data.BirthYear,p->data.BirthMonth,p->data.BirthDay);TimeNow();if(p->data.BirthYear>=ptm-> tm_year+1900){ printf("错误!学生年龄不能为负值!请重新输入!");continue;}else if(p->data.BirthMonth>=ptm-> tm_mon+1){printf("错误!学生年龄不能为负值!请重新输入!");continue;}else if(p->data.BirthDay>=ptm-> tm_mday){printf("错误!学生年龄不能为负值!请重新输入!");continue;}else{printf("请输入性别(0代表女,1代表男:\n");scanf("%d",p->data.sex);if(p->data.sex!=0||p->data.sex!=1) {printf("错误!学生年龄不能为负值!请重新输入!");continue;}else{printf("请分别输入外语、高数、C语言、马哲四门成绩:\n");scanf("%f%f%f%f",&p->data.score[0],&p->data.score[1],&p->data.score[2],&p->data.score[3]);p->next=head;head=p;}}}}*//*输出所有学生的信息*/void print(linklist head){linklist p;p=head;printf("************************************************************************* *");printf("| 学号| 姓名|性别|出生年月日|外语C语言高数马哲|总分|平均分|");printf("--------------------------------------------------------------------------");Sumstu(p);Averstu(p);while(p!=NULL){printf("%s%s%s%d%d%d%f%f%f%f%f%f",p->data.IDNumber,p->data.FamilyName,p->dat a.GivenName,p->data.sex,p->data.BirthYear,p->data.BirthMonth,p->data.BirthDay,p->data.score[0],p->data.score[1],p->data.score[2],p->data.score[3],p->data.sum,p->data.average) ;printf("\n");p=p->next;}printf("\n");}/****************************************************************************** **************/void insert(linklist L){ //插入新的结点linklist s,p=L;stu e;s=(linklist)malloc(sizeof(st));s->data=e; //头插法s->next=p->next;p->next=s;}/****************************************************************************** *************/void search(linklist L){int flag=1;char familyname[16];linklist p;printf("请输入要查询的学生姓名:\n");scanf("%s",familyname);p=L->next;while(p!=NULL){if(strcmp(familyname,p->data.FamilyName)==0){system("cls");Sumstu(p);Averstu(p);printf("************************************************************************* *");printf("| 学号| 姓名|性别|出生年月日|外语C语言高数马哲|总分|平均分|");printf("--------------------------------------------------------------------------");printf("%s%s%s%d%d%d%f%f%f%f%f%f",p->data.IDNumber,p->data.FamilyName,p->data.Gi venName,p->data.sex,p->data.BirthYear,p->data.BirthMonth,p->data.BirthDay,p->data.score[0],p->data.score[1],p->data.score[2],p->data.score[3],p->data.sum,p->data.average);printf("\n");flag=0;break;}elsep=p->next;}if(flag)printf("没有该学生信息或输入错误");Menu();}/****************************************************************************** *************************/void Delete(linklist L){linklist p,q;char num[16];int label=1;printf("请输入要删除的学生学号:\n");scanf("%s",num);p=L->next;q=L;do{if(strcmp(num,p->data.IDNumber)==0){system("cls");printf("\t发现要删除的学生信息,确认删除吗?\n");printf("\t\t确认(Y)取消(N)");getchar();if('y'||'Y'){q->next=p->next;delete p;printf("删除成功!");label=0;}else{exit(0);}}else{q=q->next;p=q->next;}} while(q->next!=NULL);if(label)printf("输入错误或者信息不存在!");}/****************************************************************************** ***************************/void Paixu(linklist L){linklist p;float s1=90,s2=80,s3=70,s4=60;p=L;int i;for(i=0;i<=4;i++){printf("****************************************************");printf("第%d科90分以上的学生:",i);if(p->data.score[i]>=s1){ printf("%s%s%s%f",p->data.IDNumber,p->data.FamilyName,p->data.GivenName, p->data.score[i]);}else{p=p->next;}if(s2<=p->data.score[i]<s1){ printf("%s%s%s%f",p->data.IDNumber,p->data.FamilyName,p->data.GivenName, p->data.score[i]);}else{p=p->next;}if(s3<=p->data.score[i]<s2){ printf("%s%s%s%f",p->data.IDNumber,p->data.FamilyName,p->data.GivenName, p->data.score[i]);}else{p=p->next;}if(s4<=p->data.score[i]<s3){ printf("%s%s%s%f",p->data.IDNumber,p->data.FamilyName,p->data.GivenName, p->data.score[i]);}else{p=p->next;}if(p->data.score[i]<s4){ printf("%s%s%s%f",p->data.IDNumber,p->data.FamilyName,p->data.GivenName, p->data.score[i]);}else{p=p->next;}}}/***************************************************************************************************//*void Query(linklist L){ //此处假设学号形式为20101407linklist p;p=L;char classs[2];float sumclass;printf("请输入您想查询的班级:\n");scanf("%s",classs);do{sumclass=p->data.score[0]+p->data.score[1]+p->data.score[2]+p->data.score[3] ;printf("%s%f",p->data.IDNumber,p->data.sum);}while((strcmp(classs[1],p->data.IDNumber[5])==0)&&(strcmp(classs[2],p->data.IDNu mber[6])==0));}/****************************************************************************** ********************/void ComputeProject(linklist L){linklist p;float sumall[4],averall[4];float Su=0,Av=0;//sumall[4]={0,0,0,0};averall[4]={0,0,0,0};int i,m=0;p=L;for(i=0;i<=4;i++){for(p=L;p->next!=NULL;p=p->next){m++;sumall[i]+=p->data.score[i];}averall[i]=sumall[i]/4;printf("第%d科的平均成绩是:\n",averall[i]);Su+=averall[i];}Av=Su/4;printf("总的平均成绩是:%f\n",Av);}/****************************************************************************** ******************/void compute(linklist L){linklist p;p=L;Sumstu(p);Averstu(p);do{printf("学号:%s\n",p->data.IDNumber);printf("总分:%f\n平均分:%f\n",p->data.sum,p->data.average);p=p->next;}while(p->next!=NULL);}/****************************************************************************** **************/void insert(linklist L, stu e){ //插入新的结点linklist s,p=L;printf("请输入要插入的学生信息:\n");scanf("%s%s%s%d%d%d%f%f%f%f%f%f",p->data.IDNumber,p->data.FamilyName,p->data.Gi venName,p->data.sex,p->data.BirthYear,p->data.BirthMonth,p->data.BirthDay,p->data.score[0],p->data.score[1],p->data.score[2],p->data.score[3],p->data.sum,p->data.average);s=(linklist)malloc(sizeof(st));s->data=e; //头插法s->next=p->next;p->next=s;}/****************************************************************************** *************/void save(linklist L){FILE *fp;linklist p; /* 定义移动指针*/char out];scanf("%s",outfile);if((fp=fopen(outfile,"w"))==NULL) /*为输出打开一个二进制文件,为只写方式*/{printf("Cannot open the file\n");return; /*若打不开则返回菜单*/}p=L; /*移动指针从头指针开始*/while(p!=NULL) /*如p不为空*/{fwrite(p,sizeof(st),1,fp); /*写入一条记录*/p=p->next; /*指针后移*/}fclose(fp); /*关闭文件*/printf("Save the !\n");}/* 从文件读数据函数*/st *Load(linklist L){linklist p1,p2,head=NULL; /*定义记录指针变量*/FILE *fp; /* 定义指向文件的指针*/char in];scanf("%s",infile);if((fp=fopen(infile,"r"))==NULL) /*打开一个二进制文件,为只读方式*/{printf("Can not open the file.\n");return(head);}printf("\nLoading the file!\n");p1=(linklist)malloc(sizeof(st)); /*开辟一个新单元*/if(!p1){printf("Out of memory!\n");return(head);}head=p1;while(!feof(fp)) /*循环读数据直到文件尾结束*/{if(fread(p1,sizeof(st),1,fp)!=1) break; /*如果没读到数据,跳出循环*/p1->next=(linklist)malloc(sizeof(st)); /*为下一个结点开辟空间*/if(!p1->next){printf("Out of memory!\n");return (head);}p2=p1; /*使p2指向刚才p1指向的结点*/p1=p1->next; /*指针后移,新读入数据链到当前表尾*/}p2->next=NULL; /*最后一个结点的后继指针为空*/fclose(fp);printf("\nYou have success to read data from the file!\n");return (L);}/****************************************************************************** **************//****************************************************************************** ***************/void main(){linklist head=initlist();for(;;){switch(Menu()){case 1 :creastlist(head);case 2 :Delete(head);case 3 :print(head);case 4 :search(head);case 5 :save(head);//case 6 :load(head);case 7 :compute(head);//case 8 : Query(head);case 9 :insert(head);case 0 :exit(0);}}}。

学生管理系统c语言简单版

学生管理系统c语言简单版

学生管理系统c语言简单版学生管理系统c语言简单版介绍:学生管理系统是一种用于管理学生信息的软件,它可以方便地对学生的基本信息、课程成绩等进行录入、查询、修改和删除等操作。

本文将介绍如何使用C语言编写一个简单的学生管理系统。

功能:1. 添加学生信息2. 查询学生信息3. 修改学生信息4. 删除学生信息5. 显示所有学生信息实现方法:1. 添加学生信息添加学生信息需要输入以下内容:姓名、性别、年龄、班级和电话号码。

我们可以定义一个结构体来存储这些信息,代码如下:```struct Student {char name[20];char sex[10];int age;char class[20];char phone[20];};```然后定义一个数组来存储多个学生的信息:```struct Student students[100];int count = 0; // 学生数量```接下来,我们可以编写一个函数来添加新的学生信息:```void addStudent() {struct Student student;printf("请输入姓名:");scanf("%s", );printf("请输入性别:");scanf("%s", student.sex);printf("请输入年龄:");scanf("%d", &student.age);printf("请输入班级:");scanf("%s", student.class);printf("请输入电话号码:");scanf("%s", student.phone);students[count++] = student; // 将新的学生信息存储到数组中 printf("添加成功!\n");}```2. 查询学生信息查询学生信息可以按照姓名或电话号码进行查询。

学生信息管理系统c语言代码

学生信息管理系统c语言代码

#include<> #include<>#include<>#define LEN 15#define N 100struct record 迎使用系统帮助!\n");printf("\n1. 进入系统后, 先刷新学生信息, 再查询;\n");printf("\n2. 按照菜单提示键入数字代号;\n");printf("\n3. 增加学生信息后, 切记保存按;\n");printf("\n4. 谢谢您的使用!\n");}voidreadfile()ode,stu[i].name,&stu[i].age,stu[i].sex,stu[i].time,stu[i].add,stu[i]. tel,stu[i].mail)==8){i++;i=i;}fclose(fp);n=i;printf(" 录入完毕!\n");}void seek()学号查询--- \n");printf(" -- 2. 按姓名查询-------- \n");printf(" -- 3. 退出本菜单--- \n");while(1){printf(" 请选择子菜单编号:");scanf("%d",&item);flag=0;switch(item){case 1:printf(" 请输入要查询的学生的学号:\n");scanf("%s",s1);for(i=0;i<n;i++)if(strcmp(stu[i].code,s1)==0)ode,stu[i].name,stu[i].age,stu[i].sex,stu[i].t ime,stu[i].add,stu[i].tel,stu[i].mail);if(flag==0){printf(" 该学号不存在!\n");}}break;case 2:printf(" 请输入要查询的学生的姓名:\n");scanf("%s",s1);for(i=0;i<n;i++)if(strcmp(stu[i].name,s1)==0)flag=1;电话E-mail\n");printf("-\n");printf("%6s %7s %6d %5s %9s %8s %10s %14s\n",stu[i].code,stu[i].n ame,stu[i] .age,stu[i].sex,stu[i].time,stu[i].add,stu[i].tel,stu[i].mail);}if(flag==0)printf(" 该姓名不存在!\n"); break;case 3:return;default:printf(" 请在1-3 之间选择\n");}}}void modify() ode,s1)==0){num=i;printf("------------- ------------ \n");printf("1.修改姓名\n");printf("2. 修改年龄\n");printf("3. 修改性别\n");printf("4. 修改出生年月\n");printf("5. 修改地址\n"); printf("6. 修改电话号码\n");printf("7.修改 E-mail 地址 \n"); printf("8. 退出本菜单 \n");printf("------------------------ \n");}while(1){printf(" 请选择子菜单编号 :"); scanf("%d",&item); switch(item){case 1:printf(" 请输入新的姓名 :\n")scanf("%s",s2); strcpy(stu[num].name,s2); break;case 2:printf(" 请输入新的年龄 :\n")scanf("%d",&stu[num].age);break;case 3:printf(" 请输入新的性别 :\n")scanf("%s",sex1); strcpy(stu[num].sex,sex1); break;case 4:printf(" 请输入新的出生年月scanf("%s",s2);strcpy(stu[num].time,s2); break;case 5:printf(" 请输入新的地址 :\n")scanf("%s",s2);strcpy(stu[num].add,s2); break;case 6:printf("请输入新的电话号码scanf("%s",s2); strcpy(stu[num].tel,s2); break;scanf("%s",s2); strcpy(stu[num].mail,s2); break;:\n");:\n");case 8:return;default:printf(" 请在1-8 之间选择\n");}}}void sort()ode,stu[j].code)>0)ode); ode,stu[j].code);strcpy(stu[j].code,temp); strcpy(temp,stu[j-1].name);strcpy(stu[j-1].name,stu[j].name);strcpy(stu[j].name,temp); strcpy(temp,stu[j-1].sex);strcpy(stu[j-1].sex,stu[j].sex); strcpy(stu[j].sex,temp);strcpy(temp,stu[j-1].time); strcpy(stu[j-1].time,stu[j].time); strcpy(stu[j].time,temp);strcpy(temp,stu[j-1].add); strcpy(stu[j-1].add,stu[j].add);strcpy(stu[j].add,temp); strcpy(temp,stu[j-1].tel);strcpy(stu[j-1].tel,stu[j].tel); strcpy(stu[j].tel,temp);strcpy(temp,stu[j-1].mail);strcpy(stu[j-1].mail,stu[j].mail);strcpy(stu[j].mail,temp);p=&stu[j-1].age;q=&stu[j].age;s=*q;*q=*p;*p=s;}}}void insert()ode);for(j=0;j<i;j++)if(strcmp(stu[i].code,stu[j].code)==0){printf(" 已有该学号, 请检查后重新录入!\n");flag=1;break;}}printf(" 请输入第%d 个学生的姓名:\n",i+1);scanf("%s",stu[i].name);printf(" 请输入第%d 个学生的年龄:\n",i+1);scanf("%d",&stu[i].age);printf(" 请输入第%d 个学生的性别:\n",i+1);scanf("%s",stu[i].sex);printf(”请输入第%d个学生的出生年月:(格式:年•月)\n",i+1);scanf("%s",stu[i].time);printf(" 请输入第%d 个学生的地址:\n",i+1);scan f("%s",stu[i].add);printf(" 请输入第%d 个学生的电话:\n",i+1);scanf("%s",stu[i].tel);printf(" 请输入第%d 个学生的E-mail:\n",i+1);scanf("%s",stu[i].mail);if(flag==0){i=i;i++;}}while(i<n+m);n+=m;printf(" 录入完毕!\n\n");sort();void del()ode,s1)==0){flag=1;for(j=i;j<n-1;j++)stu[j]=stu[j+1];if(flag==0)printf(" 该学号不存在!\n");if(flag==1){printf(" 删除成功, 显示结果请选择菜单\n");n--;}}voidode,stu[i].name,stu[i].age,stu[i].sex,stu[i].time,stu[i].add,stu[i].tel,stu[i]. mail);}}voidode,stu[i].name,stu[i].age,stu[i].sex,stu[i].time,stu[i].add,stu[i].tel,stu[i]. mail);} fclose(fp);}void menu() 统帮助及说明* * 1. 刷新学生信息* \n"); display()save()printf(" ********************************************* \n");printf(" * 2. 查询学生信息* * 3.修改学生信息* \n"); printf(" ********************************************* \n");printf(" * 4. 增加学生信息* * 5. 按学号删除信息* \n");printf(" *********************************************\n");printf(" * 6. 显示当前信息* * 7.保存当前学生信息* \n");printf(" ********************** **********************\n");printf(" * 8. 退出系统* \n");printf(" ********************** \n");printf("\n") printf(" 请选择菜单编号:"); scanf("%d",&num);switch(num){case 0:help();break;case 1:readfile();break;case 2:seek();break;case 3:modify();break;case 4:insert();break;case 5:del();break;case 6:display();break;case 7:save();break;case 8:k=0;break;default:printf(" 请在0-8 之间选择\n"); }。

c语言学生成绩管理系统代码

c语言学生成绩管理系统代码

include<stdio.h>include<string.h>include<stdlib.h>define MAXN 100 //一个班最多的人数define MAXM 2 //成绩的课程门数int R;void input; //1.学生成绩新建void sort; //2.学生成绩插入void load; //3.学生成绩修改void print; //4.学生成绩删除void total; //5.学生成绩统计void search; //6.学生成绩查询void save; //7.学生成绩保存void end; //8.结束struct student{char name20; //保存全班姓名char num12; //保存全班学号float scoreMAXM; //保存全班所有课程成绩float sum; //保存全班每个人的总成绩float avg; //保存每个人的平均成绩};struct student sMAXN;struct http{char subject20; //保存全班所有课程};struct http cMAXM;void main //欢迎首界面{int select;l;system"color fC";printf"\n";printf"\n";printf"\n";printf"\n";printf" ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n";printf" \n";printf" \n";printf" 欢迎进入终极一班学生管理系统\n";printf" \n";printf" ︻┳═一 cf ... \n";printf" ┈━═☆甘总管的多塔生活∝╬══→ \n";printf" \n";printf" 凸^-^凸凸^-^凸凸^-^凸凸^-^凸凸^-^凸凸^-^凸凸^-^凸 \n";printf" ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n";printf" ╭v╮ ╔══╗╔╗ ╔╗╔╗╭'''╮\n";printf" ^o^╚╗╔╝║║╔═╦╦╦═╗║╚╝╠═╦╦╗~ : ~\n";printf" ~ : ~╔╝╚╗║╚╣║║║║╠╣╚╗╔╣║║║║~v ~\n";printf" ╚══╝╚═╩═╩═╩═╝╚╝╚═╩═╝ \n";printf"\n";printf"\n";printf" 请按任意键进入下一界面\n";printf"------------------------------------------------------------------\n";system"pause";system"color f2";system"color f1";system"color f3";system"color fE";system"color fB";system"color f5";system"color f9";system"color f6";system"color f1";system"color f3";system"color fE";system"color fB";system"color f5";system"color f9";system"color f6";system"color f1";system"color f3";system"color f5";system"color f9";system"color f6";system"color fD";system"pause";system"color fC";system"cls"; //上面是第一个界面while1{system"cls";printf" 欢迎进入终极一班学生管理系统\n";printf" \n";printf" ∝╬══→ 1.学生成绩新建囧rz 欢\n";printf" ::======>> 2.学生成绩插入迎\n";printf" ┈━═☆ 3.学生成绩修改来\n";printf" ∝╬══→ 4.学生成绩删除到\n";printf" ∝╬══→ 5.学生成绩统计英\n";printf" ∝╬══→ 6.学生成绩查询雄\n";printf" ▄︻┻═┳ 7.学生成绩保存联\n";printf" ∝╬══→ 8.退出/撒拉嘿盟\n";printf" ⊙_⊙⊙_⊙⊙_⊙⊙_⊙⊙_⊙⊙_⊙ \n"; printf" \n";printf"\n"; printf"\n 请输入您的选择编号;回车键继续:\n";printf" ---------------------------------------------------------------------------\n";scanf"%d";&select;do{ifselect<1||select>8{printf" 您输入有误;请重新输入;谢谢\n";scanf"%d";&select;}l=select;}whilel<1||l>8;switchselect{case 1:input;break; //1.学生成绩新建case 2:sort; break; //2.学生成绩插入case 3:load; break; //3.学生成绩修改case 4:print; break; //4.学生成绩删除case 5:total;break; //5.学生成绩统计case 6:search;break; //6.学生成绩查询case 7:save;break; //7.学生成绩保存case 8: end;break; //8.结束default:printf" 请按相应数学选择系统功能:";}}}void input //1学生成绩输入成绩模块{int i;j;b;float a=0;printf" 请输入该班同学的人数:\n";printf" 班同学的人数在1~%d之间:\n";MAXN;scanf"%d";&R;do{ifR<1||R>100{printf" 您输入有误;请重新输入;谢谢\n";scanf"%d";&R;}b=R;}whileb<1||b>100;fori=0;i<MAXM;i++{printf" 请输入该班同学的第%d门课程名称为:\n";i+1;scanf"%s"; &ci.subject;}fori=0;i<R;i++{printf" 请输入第%d个同学的姓名:\n";i+1;scanf"%s";&;printf" 请输入第%d个同学的学号:\n";i+1;scanf"%s";&si.num;printf" 请依次输入%d门学科的成绩:\n";MAXM;forj=0;j<MAXM;j++{printf" 请输入课程%s的成绩为:\n";cj.subject;scanf"%f";&si.scorej;a=a+si.scorej;}si.sum=a;si.avg=si.sum/MAXM;a=0;}}void sort //2学生成绩插入成绩模块{int i;j;k;b;float a=0;printf" 请输入要插入的学生的位置1~%d号:\n";R;printf" 第几个学生的位置之后:\n";scanf"%d";&k;do{ifk<1||k>R{printf" 您输入有误;请重新输入;谢谢\n";scanf"%d";&k;}b=k;}whileb<1||b>R;R=R+1;fori=R;i>k;i--{;;strcpysi.num;si-1.num;si.sum=si-1.sum;si.avg=si-1.avg;forj=0;j<MAXM;j++{si.scorej=si-1.scorej;}}printf" 请输入第%d个同学的姓名:\n";k+1;scanf"%s";&;printf" 请输入第%d个同学的学号:\n";k+1;scanf"%s";&sk.num;printf" 请依次输入%d门学科的成绩:\n";MAXM;forj=0;j<MAXM;j++printf" 请输入课程%s的成绩为:\n";&cj.subject;scanf"%f"; &sk.scorej;a=a+sk.scorej;}sk.sum=a;sk.avg=sk.sum/MAXM;}void load //3学生成绩修改{float a=0;hMAXM;int i;j;b;printf" 请输入修改学生的位置1~%d 号: \n";R;scanf"%d";&i;do{ifi<1||i>R{printf" 您输入有误;请重新输入;谢谢\n";scanf"%d";&i;}b=i;}whileb<1||b>R;printf" 请输入%d号的新学号: \n";i;scanf"%s";&;printf" 请输入%d号的新姓名: \n";i;scanf"%s";&si-1.num;forj=0;j<MAXM;j++{printf" 请输入课程%s的成绩为:\n";&cj.subject;scanf"%f";&hj;si-1.scorej =hj;a=a+si-1.scorej;si-1.sum=a;si-1.avg=si-1.sum/MAXM;}void print //4学生成绩删除{int i;j;k;b;printf" 请输入删除学生的位置1~%d 号:\n";R;scanf"%d";&k;do{ifk<1||k>R{printf" 您输入有误;请重新输入;谢谢\n";scanf"%d";&k;}b=k;}whileb<1||b>R;i=k-1;fori;i<R;i++{;si+;strcpysi.num;si+1.num;si.sum=si+1.sum;si.avg=si+1.avg;forj=0;j<MAXM;j++{si.scorej=si+1.scorej;}}R=R-1;printf"删除成功 \n";}void total //5.学生成绩统计{int i;j;float aMAXM;b=0;printf"学号:姓名:课程%s的分数:课程%s的分数: 总成绩:平均成绩:\n";c0.subject;c1.subject;fori=0;i<R;i++{printf"%s%10.2s%16.2f%16.2f%16.2f%16.2f\n";si.num;;si.score0 ;si.score1;si.sum;si.avg;}fori=0;i<MAXM;i++{forj=0;j<R;j++{b=b+sj.scorei;}ai=b/R;b=0;}fori=0;i<MAXM;i++{printf" 全班课程%s的平均分为:%f\n";ci.subject;ai;}printf"排序完毕.\n";system"pause";}void search //6查询成绩模块{int search1;int search2;int select;index;b;while1{printf" \n";printf" 1.按学号查询\n";printf" 2.按姓名查询\n";printf" 0.返回\n";printf" 请输入您的选择编号:\n";printf" \n";scanf"%d";&select;do{ifselect<0||select>2{printf" 您输入有误;请重新输入;谢谢\n";scanf"%d";&select;}b=select;}whileb<0||b>2;switchselect{case 1:index=search1; break;case 2:index=search2;break;case 0:return;}ifindex=-1{int i;printf" \n";printf" 学号:%s \n"; sindex.num;printf" 姓名:%s \n"; ;printf" 总成绩:%f \n"; sindex.sum;printf" 平均成绩:%f \n"; sindex.avg;fori=0;i<MAXM;i++printf" 课程%s的成绩为:%f \n"; ci.subject;sindex.scorei;printf" \n";}else printf"没有这个同学..\n";}}int search1 //按学号查询模块{int i;char s_num12;printf" 请输入要查询的学号:";scanf"%s";&s_num;fori=0;i<MAXN;i++ifstrcmpsi.num;s_num==0break;ifi<MAXNreturn i;else return -1;}int search2 //按姓名查询模块{int i;char s_name10;printf" 请输入要查询的姓名:";scanf"%s";&s_name;fori=0;i<MAXN;i++;s_name==0break;ifi<MAXNreturn i;else return -1;}void save//7保存成绩模块{FILE fp;int i;j;k=0;char filename20;printf"请输入文件名请以 .txt 结束: ";scanf"%s";filename;iffp=fopenfilename; "w"==NULL{printf"打开文件失败.\n";return;}fprintffp; "该班学生数和所修课程数分别为:%d;%d\n\n";R;MAXM; fprintffp; "该班所修的课程有:\n";forj=0;j<MAXM;j++fprintffp; "课程%d:%s\n";1+j;cj.subject;fprintffp; "下面是该班学生信息:\n\n";fori=0;i<R;i++{fprintffp; "学号:%s 姓名:%s\n";si.num;;forj=0;j<MAXM;j++{fprintffp; "%s:%5.2f\n";cj.subject;sk.scorej;}fprintffp; "学生总成绩:%5.2f\n学生平均成绩:%5.2f\n\n";si.sum;si.avg;k++;}fclosefp;printf"\n\n 保存成功\n\n\n\n";fclosefp;printf"保存完毕.\n";}void end //8.结束{system"cls";system"color f4";printf"\n";printf"\n";printf"\n";printf" █◣◢█◣◢█◣◢█▁▁\n";printf"█████████████\\//\n";printf"\n";printf"◢█████████████◣//\\\n";printf"\n";printf"◢███████████████◣ ̄▌ ̄\n";printf"\n";printf" ██●███●██▌ \n";printf"\n";printf" ██◣◢███◣◢██▌\n";printf"\n";printf" ◥█████◤^◥█████◤▌\n";printf"\n";printf" ◥████◣/\◢████◤◢██\n";printf"\n";printf"◢█████████████◢██◤\n";printf"\n";printf"◢████████████████ \n";printf"\n";printf" ██◤◢███◤◥███◣\n";printf"\n";printf" ◢███◤◥███◣\n";printf"\n";printf" ████████ \n";printf"\n";printf"\n";printf"\n\n 谢谢您的使用..BYE\n\n\n\n\n\n\n\n";system"color f2";system"color f1";system"color f3";system"color fE";system"color fB";system"color f5";system"color f9";system"color f6";system"color f1";system"color f3";system"color fE";system"color fB";system"color f5";system"color f9";system"color f6";system"color f1";system"color f3";system"color f5";system"color f9";system"color f6";exit0;}。

c语言--学生信息管理系统代码

c语言--学生信息管理系统代码

#include <stdio.h>#include <stdlib.h>#include <string.h>#define FUNC_NEW 1 /* 建立新的班级学生数据*/#define FUNC_SA VE 2 /*把数据写入文件并保存*/#define FUNC_OPEN 3 /*打开文件并从里读入数据*/#define FUNC_INSERT 4 /*插入一个学生的信息*/#define FUNC_SEARCH 5 /*查找学生的信息*/#define FUNC_CHANGE 6 /*修改学生的信息*/#define FUNC_DELETE 7 /*删除学生的信息*/#define FUNC_DISPLAY 8 /*展示学生的信息*/#define FUNC_CENSUS 9 /*分段统计学生总分人数并打印*/ #define FUNG_EXIT 10/*结束程序*/#define FUNC_CLOSE 10#define MAX_NUM 45#define MAX_NAME_STRLEN 30void DoSave();void DoOpen();void DoNew();void DoInsert();void DoDisplay();void DoDelete();void DoSearch();void DoChange();void Docensus();void DoExit();//用户定义的类型声明struct _student{int id;char name[MAX_NAME_STRLEN];int Math;int English;int Chinese;int Physics;int Chemistry;float averScore;int sum;};typedef struct _student STUD;struct _studTb{STUD stud[MAX_NUM];int length;};//全局变量的定义struct _studTb si;char strClassId[15];int main(){int iUserSelect;int MainMenu();system("color 20");for(;;){iUserSelect = MainMenu();if(FUNC_CLOSE == iUserSelect)break;switch(iUserSelect){case FUNC_NEW:DoNew();break;case FUNC_OPEN:DoSave();break;case FUNC_SA VE:DoOpen();break;case FUNC_INSERT:DoInsert();break;case FUNC_SEARCH:DoSearch();break;case FUNC_CHANGE:DoChange();break;case FUNC_DELETE:DoDelete();break;case FUNC_DISPLAY:DoDisplay();break;case FUNC_CENSUS:Docensus();break;case FUNC_CLOSE :DoExit();break;default:break;}}}int MainMenu(){int iUserSelect;system("cls");printf(" --------------------------------------------------------------------- \n");printf(" | ***********欢迎来到学生管理系统********** |\n");printf(" | ****** 1> 新建学生信息****** | \n");printf(" | ****** 2> 保存学生信息****** | \n");printf(" | ****** 3> 打开学生信息****** | \n");printf(" | ****** 4> 插入学生信息****** | \n");printf(" | ****** 5> 查找学生信息****** | \n");printf(" | ****** 6> 修改学生信息****** |\n");printf(" | ****** 7> 删除学生信息****** | \n");printf(" | ****** 8> 展示学生信息的成绩排名****** | \n");printf(" | ****** 9> 分段统计学生信息****** | \n");printf(" | ****** 10> 退出学生系统****** | \n");printf(" | *****Please select a function id(1..9) to execute:***** | \n");printf(" --------------------------------------------------------------------- \n");scanf("%d",&iUserSelect);if(iUserSelect<1&&iUserSelect>9)printf("请正确输入指令\n");elsereturn iUserSelect;}void DoNew(){int number,i;system("cls");printf("\t\tFUNCION: 新建一个班级:\n");printf("\t\t请输入班级序号(string):");scanf("%s",strClassId);printf("\t\t请输入这个班有多少人:");scanf("%d",&number);for (i = 0; i < number; i++){printf("\t\t请输入学生学号:");scanf("%d",&si.stud[i].id);printf("\t\t请输入学生姓名:");scanf("%s",si.stud[i].name);printf("\t\t请输入学生成绩:\n");printf("\t\tMath English Chinese Physics Chemistry\n");scanf("%4d %4d %4d %4d %4d",\& si.stud[i].Math,& si.stud[i].English,& si.stud[i].Chinese,& si.stud[i].Physics,& si.stud[i].Chemistry);}si.length = number;}//保存学生信息void DoSave(){FILE *fp;int i;system("cls");if((fp=fopen("stu-list.txt","wb"))==NULL){printf("打开文件失败\n");return;}for(i=0;i<si.length;i++){if(fwrite(&si.stud[i],sizeof(si),1,fp)==1)printf("保存成功\n");}fclose(fp);}//开文件读取学生信息void DoOpen(){FILE *fp;int i=0;system("cls");if((fp=fopen("stu-list.txt","ab+"))==NULL){printf("打开文件失败\n");return;}while(!feof(fp)){if(fread(&si.stud[i],sizeof(si),1,fp)==1)i++;}fclose(fp);for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 数学:%d 英语:%d 语文:%d 物理:%d 化学:%d\n",si.stud[i].id,si.stud[i].name,si.stud[i].Math,si.stud[i].English,si.stud[i].Chinese,si.stud[i].Physics,si.stud[i].Chemistry);}//插入学生信息void DoInsert(){FILE *fp;int j,INid,sid;int m=0,i=0,k=0;system("cls");if((fp=fopen("stu-list.txt","ab+"))==NULL){ printf("\t文件打开失败!");getchar();return;}while(!feof(fp)){if(fread(&si.stud[i],sizeof(si),1,fp)==1)m++;i++;}/*if(m==0){printf("没有学生记录!");fclose(fp);return;}*/printf("\t请输入要插入信息在那个学号之后:\n");scanf("%d",&INid);for(i=0;i<m;i++)if(INid==si.stud[i].id)break;for(j=m-1;j>i;j--)si.stud[j+1]=si.stud[j];stare1:printf("\t请输入要插入的学生的信息:\n");printf("\t请输入要插入的学号");scanf("%d",&sid);while(k<m){if(si.stud[k].id==sid){printf("\t 该学号已经存在,不允许重复插入!\n");goto stare1;}k++;}si.stud[i+1].id=sid;printf("\t请输入你想输入的姓名");scanf("%s",si.stud[i+1].name);printf(" Math English Chinese Physics Chemistry\n");scanf("%d %d %d %d %d",& si.stud[i+1].Math,& si.stud[i+1].English,& si.stud[i+1].Chinese,& si.stud[i+1].Physics,& si.stud[i+1].Chemistry);si.length=si.length+1;DoSave();}//在文件中查找学生信息,支持姓名学号查找void DoSearch(){int i=0,choice,Sid;char sname[MAX_NAME_STRLEN];int flag=0;system("cls");DoOpen();printf("\n1按姓名查找:\n2按学号查找:");scanf("%d",&choice);switch(choice){case 1: printf("请你输入要查找的姓名");scanf("%s",sname);while(i<si.length){if(strcmp(si.stud[i].name,sname)==0){flag=1;printf("学号:%d 姓名:%s 数学成绩:%d 英语成绩:%d 语文成绩:%d 物理成绩:%d 化学成绩:%d\n",si.stud[i].id,si.stud[i].name ,si.stud[i].Math,si.stud[i].English,si.stud[i].Chinese,si.stud[i].Physics,si.stud[i].Chemistry);}i++;}if(flag==0)printf("你输入的姓名不存在,请确认后再输入");break;case 2: printf("请你输入要查找的学号");scanf("%d",&Sid);while(i<si.length){if(Sid==si.stud[i].id){flag=1;printf("学号:%d 姓名:%s 数学成绩:%d 英语成绩:%d 语文成绩:%d 物理成绩:%d 化学成绩:%d\n",si.stud[i].id,si.stud[i].name ,si.stud[i].Math,si.stud[i].English,si.stud[i].Chinese,si.stud[i].Physics,si.stud[i].Chemistry);}i++;}if(flag==0)printf("你输入的学号不存在,请确认后再输入");break;}printf(" Please input a number to continue!");scanf("%d",&i);return;}//对学生信息进行修改void DoChange(){int choice1;int i=0;int onum;char choice2;system("cls");DoOpen();printf("你想对那个学生进行操作,请输入学号\n");scanf("%d",&onum);while(onum!=si.stud[i].id)i++;if(onum==si.stud[i].id){printf("\n你要修改哪一项");printf("1学号\n2姓名\n3数学成绩\n4英语成绩\n5语文成绩\n6物理成绩\n7化学成绩");printf("请选择");scanf("%d",&choice1);switch(choice1){case 1: printf("\n请输入修改后的学号");scanf("%d",&si.stud[i].id);break;case 2: printf("\n输入你要修改的姓名");scanf("%s",&si.stud[i].name);break;case 3: printf("\n请输入要修改的成绩");scanf("%d",&si.stud[i].Math);break;case 4: printf("\n请输入要修改的成绩");scanf("%d",&si.stud[i].English);break;case 5: printf("\n请输入要修改的成绩");scanf("%d",&si.stud[i].Chinese);break;case 6: printf("\n请输入要修改的成绩");scanf("%d",&si.stud[i].Physics);break;case 7: printf("\n请输入要修改的成绩");scanf("%d",&si.stud[i].Chemistry);break; }}elseprintf("没有该同学信息");printf(" Please input a number(0..9) to continue!");scanf("%d",&i);}//删除学生信息void DoDelete(){int i,id;char fname[MAX_NAME_STRLEN];system("cls");DoOpen();printf("请输入学生学号");scanf("%d",&id);i=0;while(si.stud[i].id!=id)i++;if(si.stud[i].id==id){while(i<si.length-1){si.stud[i]=si.stud[i+1];i++;}si.length=si.length-1;for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 数学:%d 英语:%d 语文:%d 物理:%d 化学:%d \n",si.stud[i].id,si.stud[i].name,si.stud[i].Math,si.stud[i].English,si.stud[i].Chinese,si.stud[i].Physics,si.stud[i].Chemistry);}elseprintf("没有该同学信息");printf(" Please input a number(0..9) to continue!");scanf("%d",&i);}//展示学生信息void DoDisplay(){struct _studTb m;int i,j,n;system("cls");DoOpen();printf("请选择\n1.数学排名2.英语排名3.语文排名 4.物理排名 5.化学排名 6.学生总分并排序7.学生平均分并排序\n");scanf("%d",&n);if(n==1){for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j-1;i++)if(si.stud[i].Math<si.stud[i+1].Math){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 数学成绩排名:%d\n", si.stud[i].id, si.stud[i].name ,si.stud[i].Math);}else if(n==2){for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j;i++)if(si.stud[i].English<si.stud[i+1].English){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 英语成绩排名:%d\n", si.stud[i].id, si.stud[i].name ,si.stud[i].English);}else if(n==3){for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j;i++)if(si.stud[i].Chinese<si.stud[i+1].Chinese){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 语文成绩排名:%d\n", si.stud[i].id, si.stud[i].name, si.stud[i].Chinese);}else if(n==4){for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j;i++)if(si.stud[i].Physics<si.stud[i+1].Physics){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s OS成绩排名:%d\n", si.stud[i].id, si.stud[i].name, si.stud[i].Physics);}else if(n==5){for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j;i++)if(si.stud[i].Chemistry<si.stud[i+1].Chemistry){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s C语言成绩排名:%d\n", si.stud[i].id, si.stud[i].name,si.stud[i].Chemistry);}else if(n==6){for(i=0;i<si.length;i++)si.stud[i].sum=si.stud[i].Math+si.stud[i].English+si.stud[i].Chinese+si.stud[i].Physics+si.stud [i].Chemistry;for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j;i++)if(si.stud[i].sum<si.stud[i+1].sum){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 总分成绩排名:%f\n", si.stud[i].id, si.stud[i].name, si.stud[i].sum);}else if(n==7){for(i=0;i<si.length;i++){si.stud[i].sum=si.stud[i].Math+si.stud[i].English+si.stud[i].Chinese+si.stud[i].Physics+si.stud [i].Chemistry;si.stud[i].averScore=(float)si.stud[i].sum/si.length;}for(j=0;j<si.length-1;j++){for(i=0;i<si.length-j;i++)if(si.stud[i].averScore<si.stud[i+1].averScore){m.stud[1]=si.stud[i];si.stud[i]=si.stud[i+1];si.stud[i+1]=m.stud[1];}}for(i=0;i<si.length;i++)printf("学号:%d 姓名:%s 平均成绩排名:%f\n", si.stud[i].id, si.stud[i].name, si.stud[i].averScore);}printf(" Please input a number(0..9) to continue!");scanf("%d",&i);}//统计学生信息void Docensus(){struct _studTb sen;int mark;int sum=0;int i=0;system("cls");DoOpen();printf("请输入要统计多少分以上的学生信息");scanf("%d",&mark);while(i<si.length){ if(si.stud[i].Math>mark){sen.stud[sum]=si.stud[i];sum++;}i++;}printf("一共有:%d人\n",sum);for(i=0;i<sum;i++)printf("他的学号%4d姓名%s数学成绩%4d英语成绩%4d 语文成绩%4d 物理成绩%4d 化学成绩%4d\n ",sen.stud[i].id,sen.stud[i].name,sen.stud[i].Math,sen.stud[i].English,sen.stud[i].Chinese,sen.stud[i].Physics,sen.stud[i].Chemistry);printf(" Please input a number(0..9) to continue:");scanf("%d",&i);}void DoExit(){printf("\t\t 谢谢使用!\n");printf("\t\t");system("pause");exit(0);}。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

#include<iostream>#include<fstream>#include<string>#include <iomanip>#include<windows.h>#include<ctime>using namespace std;const int NAME_NUM=30;struct student{char name[NAME_NUM];float num;float chinaNum;float englishNum;float mathNum;float average;float result;int pos;student *next;};void Print(student *head);void InsertFront(student* &head, student *pNew);void InsertRear(student* &head, student *pNew);student* Find(student *head, char *findStr, char type); student* Read();void Write(student* head);void ShowList(student* head);int GetLength(student* head);void Delete(student* &head, char *delStr,int delNum);void FindMaxOrMin(student *head,char type,char maxOrMin); void Reword(student *pStd);void Sort(student *&head, char type,char maxOrMin);void Count(student *&head);void DeleteAll(student *&head);bool Enter(char type);void SetTitle(bool isLoad);void AboutMe();void ChaXun(string str,student *head);void PaiMing(string str, student* head);void ShanChu(string str, student *&head);void XianShi(string str, student *head);void XuiGai(string str, student *&head);void ZengJia(string str, student* &head);int Run();bool Enter(char type){ofstream out("Password.pwd",ios::app);ifstream in("Password.pwd");string s[2];int num=0;string zhangHao;string miMa;while(!in.eof()){in>>s[num];num++;if(num==2){break;}}if(s[0].compare("")==0 || type=='2' ){if(s[0].compare("")==0 && type!='2'){cout<<"你是第一次使用本程序,请设置帐号和密码."<<endl; }else{bool isLoad=false;isLoad=Enter('1');if(isLoad==true){cout<<"修改用户."<<endl;out.close();out.open("Password.pwd",ios::trunc);}else{cout<<"你输入的密码错误."<<endl;cout<<"你不是管理员不能修改密码."<<endl; return false;}}cout<<"请输入您的新帐号: ";cin>>s[0];cout<<"请输入您的新密码: ";cin>>s[1];string s1,s2;for(int i=0; i<s[0].size(); i++){s1+=char(int(s[0][i])+11);}for( i=0; i<s[1].size(); i++){s2+=char(int(s[1][i])+11);}s[0]=s1;s[1]=s2;for( i=0; i<=1; i++){out<<s[i]<<" ";}out.close();}string s1,s2;for(int i=0; i<s[0].size(); i++){s1+=char(int(s[0][i])-11);}for( i=0; i<s[1].size(); i++){s2+=char(int(s[1][i])-11);}cout<<"请输入您的帐号: ";cin>>zhangHao;cout<<"请输入您的密码: ";cin>>miMa;if(pare(s1)==0 && pare(s2)==0) {return true;}else{return false;}return false;}void Print(student *head){student *pHead=head;int num=strlen(head->name);while(head){if(num<strlen(head->name)){num=strlen(head->name);}head=head->next;}head=pHead;cout<<setw(num)<<head->name<<setw(8)<<head->num<<setw(10)<<head->chinaNum<<setw(10)<<head->mathNum<<setw(10)<<head->englishNum<<setw(8)<<head->result<<setw(8)<<head->average<<setw(5)<<head->pos<<endl; }void ShowList(student* head){cout<<"姓名:"<<setw(8)<<"座号:"<<setw(10)<<"语文分数:"<<setw(10) <<"数学分数:"<<setw(10)<<"英语分数:"<<setw(8)<<"总分数:"<<setw(8)<<"平均分:"<<setw(6)<<"名次:"<<endl<<endl; while(head){Count(head);Print(head);head=head->next;}cout<<endl;}void Write(student* head){ofstream out("Student.dat",ios::trunc);while(head){Count(head);out.write((char*)head,sizeof(student)); head=head->next;}out.close();}student* Read(){ifstream in("Student.dat");student *head;student *pP;student *pEnd;pP=new student;pEnd=head=pP;student *pS=new student;memset(pS->name,0,NAME_NUM); in.read((char*)pS,sizeof(student));if(strcmp(pS->name,"\0")==0){return NULL;}strcpy(pP->name,pS->name);pP->num=pS->num;pP->chinaNum=pS->chinaNum;pP->englishNum=pS->englishNum;pP->mathNum=pS->mathNum;while(!in.eof()){in.read((char*)pS,sizeof(student));pEnd->next=pP;pEnd=pP;pP=new student;strcpy(pP->name,pS->name);pP->num=pS->num;pP->chinaNum=pS->chinaNum;pP->englishNum=pS->englishNum;pP->mathNum=pS->mathNum;}pEnd->next=NULL;delete pP;return head;}student* Find(student *head,char *findStr, char type){/*参数说明:type=='1' 按名字查找type=='2' 按座号查找type=='3' 按语文查找type=='4' 按数学查找type=='5' 按英语查找type=='6' 按总分查找type=='7' 按平均分查找type=='8' 按排名查找 //没有实现*/bool isFind=false;student *firstStd=NULL;cout<<"姓名:"<<setw(8)<<"座号:"<<setw(10)<<"语文分数:"<<setw(10) <<"数学分数:"<<setw(10)<<"英语分数:"<<setw(8)<<"总分数:"<<setw(8)<<"平均分:"<<setw(5)<<"名次:"<<endl<<endl;while(head){if(type=='1'){if(strcmp(head->name,findStr)==0){if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='2'){if(int(head->num)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='3'){if(int(head->chinaNum)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='4'){if(int(head->mathNum)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='5'){if(int(head->englishNum)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='6'){if(int(head->result)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='7'){if(int(head->average)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}else if(type=='8'){if(int(head->pos)==int(atof(findStr))) {if(firstStd==NULL){firstStd=head;}Print(head);isFind=true;if(head->next==NULL){return firstStd;}}}head=head->next;}if(isFind==false){cout<<"找不到你要找的记录."<<endl;return NULL;}return firstStd;}void InsertRear(student* &head,student *pNew) {student *pEnd,*pHead,*pS=new student;if(head==NULL){InsertFront(head,pNew);return ;}pHead=head;while(head){pEnd=head;if(head->next==NULL){break;}head=head->next;}strcpy(pS->name,pNew->name);pS->num=pNew->num;pS->chinaNum=pNew->chinaNum;pS->englishNum=pNew->englishNum;pS->mathNum=pNew->mathNum;pS->next=NULL;pEnd->next=pS;head=pHead;}void InsertFront(student* &head, student *pNew) {student *pHead=new student;strcpy(pHead->name,pNew->name);pHead->num=pNew->num;pHead->chinaNum=pNew->chinaNum;pHead->englishNum=pNew->englishNum; pHead->mathNum=pNew->mathNum;pHead->next=head;head=pHead;}int GetLength(student *head){int len=0;while(head){len++;head=head->next;}return len;}void Delete(student* &head, char *delStr,int delNum) {student* pDel,*pNew,*pHead;bool isFind=false;pHead=head;if(strcmp(head->name,delStr)==0){pNew=head->next;delete head;head=pNew;if(delNum==2)cout<<endl<<"因为要删除的记录在前面,所有只删除第一记录."<<endl; }return ;}while(head->next){if(delNum==2){if(strcmp(head->next->name,delStr)==0){pNew=head->next->next;pDel=head->next;delete pDel;head->next=pNew;head=pHead;isFind=true;}}else{if(strcmp(head->next->name,delStr)==0){pNew=head->next->next;pDel=head->next;delete pDel;head->next=pNew;head=pHead;return ;}}head=head->next;}head=pHead;if(isFind==false){cout<<"找不到你要删除的记录."<<endl;}else{cout<<"删除记录成功."<<endl;}void FindMaxOrMin(student *head,char type,char maxOrMin) {/*参数说明:type=='1' 按语文查找type=='2' 按数学查找type=='3' 按英语查找type=='4' 按总分查找type=='5' 按平均分查找type=='6' 按排名查找*/int maxNum;student *pHead=head;if(type=='1'){maxNum=int(head->chinaNum);}else if (type=='2'){maxNum=int(head->mathNum);}else if (type=='3'){maxNum=int(head->englishNum);}else if (type=='4'){maxNum=int(head->result);}else if (type=='5'){maxNum=int(head->average);}else if (type=='6'){maxNum=head->pos;}else{cout<<"你输入错误,请重新输入."<<endl; return ;}while(head){if(maxOrMin=='1'){if(type=='1'){if(maxNum<int(head->chinaNum)){maxNum=int(head->chinaNum);}}else if (type=='2'){if(maxNum<int(head->mathNum)){maxNum=int(head->mathNum);}}else if (type=='3'){if(maxNum<int(head->englishNum)){maxNum=int(head->englishNum);}}else if (type=='4'){if(maxNum<int(head->result)){maxNum=int(head->result);}}else if (type=='5'){if(maxNum<int(head->average)){maxNum=int(head->average);}else if (type=='6'){if(maxNum<head->pos){maxNum=head->pos;}}}else{if(type=='1'){if(maxNum>int(head->chinaNum)) {maxNum=int(head->chinaNum);}}else if (type=='2'){if(maxNum>int(head->mathNum)) {maxNum=int(head->mathNum);}}else if (type=='3'){if(maxNum>int(head->englishNum)) {maxNum=int(head->englishNum); }}else if (type=='4'){if(maxNum>int(head->result)){maxNum=int(head->result);}}else if (type=='5'){if(maxNum>int(head->average))maxNum=int(head->average);}}else if (type=='6'){if(maxNum>head->pos){maxNum=head->pos;}}}head=head->next;}head=pHead;cout<<"姓名:"<<setw(8)<<"座号:"<<setw(10)<<"语文分数:"<<setw(10) <<"数学分数:"<<setw(10)<<"英语分数:"<<setw(8)<<"总分数:"<<setw(8)<<"平均分:"<<setw(5)<<"名次:"<<endl<<endl;while(head){if(type=='1'){if(int(head->chinaNum)==maxNum){Print(head);}}else if (type=='2'){if(int(head->mathNum)==maxNum){Print(head);}}else if (type=='3'){if(int(head->englishNum)==maxNum){Print(head);}else if (type=='4'){if(int(head->result)==maxNum){Print(head);}}else if (type=='5'){if(int(head->average)==maxNum){Print(head);}}else if (type=='6'){if(head->pos==maxNum){Print(head);}}head=head->next;}}void Reword(student *pStd){if(pStd!=NULL){cout<<"请输入学生的新名字:"<<endl; cin>>pStd->name;cout<<"请输入学生的座号"<<endl; cin>>pStd->num;cout<<"请输入学生的语文分数"<<endl; cin>>pStd->chinaNum;cout<<"请输入学生的数学分数"<<endl; cin>>pStd->mathNum;cout<<"请输入学生的英语分数"<<endl; cin>>pStd->englishNum;}{return ;}}void Sort(student *&head, char type,char maxOrMin) {/*参数说明:type=='1' 按语文排列type=='2' 按数学排列type=='3' 按英语排列type=='4' 按总分排列type=='5' 按平均分排列type=='6' 按座号排列*/student *pHead,*pH;pHead=pH=head;int len=GetLength(head);float *array=new float[len];int i;int x=0;float num=0;while(head){Count(head);if(type=='1'){num=head->chinaNum;}else if(type=='2'){num=head->mathNum;}else if(type=='3'){num=head->englishNum;}else if(type=='4'){num=head->result;}else if(type=='5'){num=head->average; }else if(type=='6'){num=head->num;}array[x]=num;x++;head=head->next;}head=pHead;if(maxOrMin=='1') {for( i=1; i<len; i++) {for(int j=0; j<len-i; j++) {if(array[j]<array[j+1]) {float num;num=array[j];array[j]=array[j+1]; array[j+1]=num;}}}}else{for( i=1; i<len; i++) {for(int j=0; j<len-i; j++) {if(array[j]>array[j+1]) {float num;num=array[j];array[j]=array[j+1]; array[j+1]=num;}}}}int pos=1;for(i=0; i<len; i++){head=pHead;while(head){if(type=='1'){num=head->chinaNum;}else if(type=='2'){num=head->mathNum;}else if(type=='3'){num=head->englishNum;}else if(type=='4'){num=int(head->result);}else if(type=='5'){num=int(head->average);}else if(type=='6'){num=int(head->num);}int n=0;if(int(array[i])==int(num)){if(int(array[i])!=int(array[i+1])) {if(n==0){}head->pos=pos;pos++;}else{head->pos=n;}}head=head->next;}}head=pH;delete []array;}void Count(student *&head){head->result=head->chinaNum+head->englishNum+head->mathNum;head->average=head->result/3;}void DeleteAll(student* &head){student *cp,*np;cp=head;while(cp){np=cp->next;delete cp;cp=np;}head=NULL;}void ChaXun(string str,student *head){Sort(head,'4','1');cout<<"欢迎使用查询功能"<<endl<<endl;cout<<"请输入你要按什么查询 1->一般查询 2->查找最多 3->查找最少"<<endl; string s;while(s[0]!='1'&&s[0]!='2'&&s[0]!='3'){cout<<"你输入错误,请重新输入."<<endl;cin>>s;}if(s[0]=='1'){cout<<"按什么查询?"<<endl;cout<<"1->姓名 2->座号 3->语文成绩 4->数学成绩 " <<"5->英语成绩 6->总分 7->平均分 8->排名"<<endl; cin>>str;while(str[0]!='1' && str[0]!='2' &&str[0]!='3' && str[0]!='4' &&str[0]!='5' && str[0]!='6' &&str[0]!='7' && str[0]!='8' ){cout<<"你输入错误,请重新输入."<<endl;cin>>str;}char findStr[30];cout<<"请输入要查找的关键字或关键数:"<<endl; cin>>findStr;switch(str[0]){case '1':Find(head,findStr,'1');break;case '2':Find(head,findStr,'2');break;case '3':Find(head,findStr,'3');break;case '4':Find(head,findStr,'4');break;case '5':Find(head,findStr,'5');break;case '6':Find(head,findStr,'6');case '7':Find(head,findStr,'7');break;case '8':Find(head,findStr,'8');break;}}else if(s[0]=='2'){cout<<"请输入要按什么查询?"<<endl;cout<<"1->语文成绩 2->数学成绩 "<<"3->英语成绩 4->总分 5->平均分 6->排名"<<endl; string s;cin>>s;switch(s[0]){case '1':FindMaxOrMin(head,'1','1');break;case '2':FindMaxOrMin(head,'2','1');break;case '3':FindMaxOrMin(head,'3','1');break;case '6':FindMaxOrMin(head,'6','1');break;case '5':FindMaxOrMin(head,'5','1');break;default:FindMaxOrMin(head,'4','1');break;}}else if(s[0]=='3'){cout<<"请输入要按什么查询?"<<endl;cout<<"1->语文成绩 2->数学成绩 "<<"3->英语成绩 4->总分 5->平均分 6->排名"<<endl; string s;switch(s[0]){case '1':FindMaxOrMin(head,'1','2');break;case '2':FindMaxOrMin(head,'2','2');break;case '3':FindMaxOrMin(head,'3','2');break;case '6':FindMaxOrMin(head,'6','2');break;case '5':FindMaxOrMin(head,'5','2');break;default:FindMaxOrMin(head,'4','2');break;}}}void ZengJia(string str, student* &head){student *pNew=new student;cout<<"欢迎使用增加功能"<<endl<<endl;cout<<"请输入新学生的名字 :"<<endl;cin>>pNew->name;cout<<"请输入新学生的座号 :"<<endl;cin>>pNew->num;cout<<"请输入他的语文分数 :"<<endl;cin>>pNew->chinaNum;cout<<"请输入他的数学分数"<<endl;cin>>pNew->mathNum;cout<<"请输入他的英语分数"<<endl;cin>>pNew->englishNum;cout<<"插入记录的 (1->最前面 2->最后面)"<<endl; cin>>str;while(str[0]!='1' && str[0]!='2'){cout<<"你输入错误,请重新输入."<<endl;cout<<"插入记录的 (1->最前面 2->最后面)"<<endl;cin>>str;}if(str[0]=='1'){InsertFront(head,pNew);}else if(str[0]=='2'){InsertRear(head,pNew);}cout<<"新学生增加成功."<<endl;}void ShanChu(string str, student *&head){char delStr[30];cout<<"欢迎使用删除功能"<<endl<<endl;cout<<"1->查询删除 2->全部删除"<<endl;cin>>str;while(str[0]!='1' && str[0]!='2'){cout<<"输入错误,请重新输入."<<endl;cin>>str;}if(str[0]=='1'){cout<<"请输入要删除的关键字"<<endl;cin>>delStr;cout<<"1->删除第一条找到的记录 2->删除所有找到的记录"<<endl; cin>>str;while(str[0]!='1'&&str[0]!='2'){cout<<"你输入错误,请重新输入."<<endl;cin>>str;}cout<<"你真的要删除吗? 1->删除 2->取消"<<endl;string s;cin>>s;if(str[0]=='1'){if(str[0]=='1'){Delete(head,delStr,1);}else{Delete(head,delStr,2);}}else{cout<<"你已经取消删除了."<<endl;}}else{cout<<"你真的要删除全部数据吗?这样会使你的数据全部丢失哦."<<endl; cout<<"1->全部删除 2->取消删除"<<endl;cin>>str;if(str[0]=='1'){DeleteAll(head);}else{cout<<"你已经取消删除了."<<endl;}}}void PaiMing(string str, student* head){string s;cout<<"欢迎使用排名功能"<<endl<<endl;cout<<"排名选择: 1->升序 2->降序"<<endl;cin>>s;cout<<"请输入要按什么排名?"<<endl;cout<<"1->语文成绩 2->数学成绩 3->英语成绩 "<<"4->总分 5->平均分 6->座号"<<endl;cin>>str;while(str[0]!='1' && str[0]!='2' &&str[0]!='3' && str[0]!='4' &&str[0]!='5' && str[0]!='6' ){cout<<"你输入错误,请重新输入."<<endl;cin>>str;}cout<<"姓名:"<<setw(8)<<"座号:"<<setw(10)<<"语文分数:"<<setw(10) <<"数学分数:"<<setw(10)<<"英语分数:"<<setw(8)<<"总分数:"<<setw(8)<<"平均分:"<<setw(6)<<"名次:"<<endl<<endl; if(s[0]=='2'){switch(str[0]){case '1':Sort(head,'1','1');break;case '2':Sort(head,'2','1');break;case '3':Sort(head,'3','1');break;case '4':Sort(head,'4','1');break;case '5':Sort(head,'5','1');break;case '6':Sort(head,'6','1');break;}}else{switch(str[0]){case '1':Sort(head,'1','2');break;case '2':Sort(head,'2','2');break;case '3':Sort(head,'3','2');break;case '4':Sort(head,'4','2');break;case '5':Sort(head,'5','2');break;case '6':Sort(head,'6','2');break;}}ShowList(head);return ;}void XianShi(string str, student *head){Sort(head,'4','1');string s;cout<<"欢迎使用显示功能"<<endl;cout<<"1->显示全部记录 2->显示记录数目"<<endl; cin>>s;if(s[0]=='2'){cout<<"记录的数目是:"<<GetLength(head)<<endl;}else{ShowList(head);}}void XuiGai(string str, student *&head){string s;student *std;cout<<"欢迎使用修改功能"<<endl;cout<<"请输入你要按什么查询"<<endl;cout<<"1->姓名 2->座号 3->语文成绩 4->数学成绩 " <<"5->英语成绩 "<<endl;cin>>str;while(str[0]!='1' && str[0]!='2' &&str[0]!='3' && str[0]!='4' &&str[0]!='5' ){cout<<"你输入错误,请重新输入."<<endl;cin>>str;}char findStr[30];cout<<"请输入要查找的关键字或关键数:"<<endl; cin>>findStr;switch(str[0]){case '1':std=Find(head,findStr,'1');Reword(std);break;case '2':std=Find(head,findStr,'2');Reword(std);break;case '3':std=Find(head,findStr,'3');Reword(std);break;case '4':std=Find(head,findStr,'4');Reword(std);break;case '5':std=Find(head,findStr,'5');Reword(std);break;}Write(head);if(std!=NULL){cout<<"修改成功."<<endl;}}int Run(){bool isLoad=false;student* head=NULL;student *pNew=new student;head=Read();SetTitle(false);if(head!=NULL){ Sort(head,'5','1');Count(head);}string str;SetTitle(false);cout<<" 欢迎使用学生管理系统 "<<endl<<endl;cout<<" 1->用户登陆 2->退出程序 "<<endl;cin>>str;if(str[0]=='2'){AboutMe();return 0;}else{isLoad=Enter('1');system("cls");if(isLoad==true){SetTitle(true);cout<<" 恭喜,您输入的密码正确.可以对本系统的进行任何操作."<<endl; }else{cout<<" Sorry,您输入的密码错误.你不能修改本系统的任何内容."<<endl; }begin:cout<<endl<<endl;cout<<" 欢迎使用学生管理系统 "<<endl<<endl; cout<<" 1->增加功能 2-查询功能"<<endl;cout<<" 3->删除功能 4-排名功能"<<endl;cout<<" 5->显示功能 6-修改功能"<<endl;cout<<" 7->用户设置 8-退出程序"<<endl;cout<<"请输入您的选择: "<<endl;cin>>str;while(str[0]!='8'){if(isLoad==true && head!=NULL){cout<<endl<<endl;if(str[0]=='1'){ZengJia(str, head);Sort(head,'4','1');Write(head);}else if(str[0]=='2'){ChaXun(str,head);}else if(str[0]=='3'){ShanChu(str,head);Sort(head,'4','1');Write(head);}else if(str[0]=='4'){PaiMing(str,head);}else if(str[0]=='5'){XianShi(str,head);}else if(str[0]=='6'){XuiGai(str,head);Write(head);else if(str[0]=='7'){cout<<"欢迎使用用户修改功能"<<endl;isLoad=Enter('2');}else if(str[0]=='8'){AboutMe();return 0;}else{cout<<"你输入错误,请重新输入."<<endl;goto begin;}}else if(isLoad==false && head!=NULL){if(str[0]=='2'){ChaXun(str,head);}else if(str[0]=='4'){PaiMing(str,head);}else if(str[0]=='5'){XianShi(str,head);}else{cout<<"你不是管理员,不能进行此项功能."<<endl;cout<<"你只能进行查询功能显示功能排名功能"<<endl;}}else if( head==NULL && isLoad==true){cout<<"系统检查到你没有任何记录,不能进行任何操作,只能增加记录."<<endl; ZengJia(str, head);Write(head);head=Read();}else if( head==NULL && isLoad==false){cout<<"因为你没有登陆,系统又检查到你没有任何记录,你不能进行任何操作."<<endl; }cout<<endl<<endl;cout<<"按任何键继续进行操作."<<endl;getchar();getchar();system("cls");goto begin;}AboutMe();return 0;}void SetTitle(bool isLoad){HWND hwnd=GetForegroundWindow();if(isLoad==false){SetWindowText(hwnd," 学生管理系统(没有登陆)");}else{SetWindowText(hwnd," 学生管理系统(已经登陆)");}system("color a");}void AboutMe(){char*pStr= " ┃ \n"" ┃ \n"。

相关文档
最新文档