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);
数据结构源代码(学生信息管理系统)

printf("手机号: ");
scanf("%s", s->tel);
printf("电子邮箱: ");
scanf("%s", s->mail);
while(p->next!=NULL)
{
p=p->next;
}
if(p->next==NULL)
{
p->next=s;
{
if(!strcmp(a,q->sex))
{
printf("|*********************查询结果*******************************|\n");
printf("编号------姓名------性别--------手机号--------电子邮箱\n");
printf(" \n %3d,%8s,%8s,%8s,%8s\n ",q->num,q->name,q->sex,q->tel,q->mail);
p=p->next;
break;
}
return h;
}
Status Insert(node *head) /*插入信息*/
{
node *p,*s; /*p、s为临时结点*/
p=head;
s=(node *)malloc(sizeof(node)); /*生成新结点*/
printf("请输入信息:");
printf("|***********************************************************|\n");
c语言管理系统设计源代码

c语言管理系统设计源代码以下是一个简单的C语言管理系统示例,用于管理学生信息。
该系统可以添加、删除、修改和查找学生信息。
c复制代码#include<stdio.h>#include<stdlib.h>#include<string.h>struct student {char name[50];int roll;float marks;};struct student students[100];int count = 0;void add_student() {struct student new_student;printf("Enter name: ");scanf("%s", new_);printf("Enter roll number: ");scanf("%d", &new_student.roll);printf("Enter marks: ");scanf("%f", &new_student.marks);students[count] = new_student;count++;}void delete_student() {int index;printf("Enter index of student to delete: ");scanf("%d", &index);for (int i = index; i < count - 1; i++) {students[i] = students[i + 1];}count--;}void modify_student() {int index;struct student new_student;printf("Enter index of student to modify: "); scanf("%d", &index);printf("Enter new name: ");scanf("%s", new_);printf("Enter new roll number: ");scanf("%d", &new_student.roll);printf("Enter new marks: ");scanf("%f", &new_student.marks);students[index] = new_student;}void find_student() {char name[50];printf("Enter name of student to find: "); scanf("%s", name);for (int i = 0; i < count; i++) {if (strcmp(students[i].name, name) == 0) { printf("Roll number: %d\n", students[i].roll); printf("Marks: %.2f\n", students[i].marks); return;}}printf("Student not found.\n");}int main() {int choice;do {printf("\nMenu:\n");printf("1. Add student\n");printf("2. Delete student\n");printf("3. Modify student\n");printf("4. Find student\n");printf("5. Exit\n");printf("Enter choice: ");scanf("%d", &choice);switch (choice) {case1: add_student(); break;case2: delete_student(); break;case3: modify_student(); break;case4: find_student(); break;case5: exit(0); break; // exit the program here, otherwise the loop will keep running indefinitely, as it is in the do-while loop above. We are not returning, but rather exiting the program completely, so we do not need to return anything. The return value of main is always 0, and this is how the program exits. If you want to return a value other than 0, you can do so like this: return 1; or return -1; or return any other integer value you want to represent an error condition. The operating system will interpret this as the program's exit status. In this case, it will be seen as successful, as it is returning 0. The return value of main is not used for anything in this program, but it can be used in other programs to determine whether the program exited successfully or with an error. For example, if you were writing a shell script that executed this program and needed to know if it was successful or not, you could check the return value of the program and act accordingly. This is a common practice in programming, and it is important to understand how it works so that you can use it effectively in your own programs.。
学生成绩管理系统C语言源程序

for(p=head->next;p!=NULL&&strcmp(p->name,tem);p=p->next);
if (!p)
{
printf("\n\n找不到你要查询的姓名,请重新输入,输入0表\
示结束:");
scanf("%s",tem);
}
else if (!strcmp(p->name,tem))
n=0;
head=(Student *)malloc(LEN);
p2=head;
printf("\n请输入第%d名学生的学号,学号为0表示结束输入:",n+1);
scanf("%d",&flag);
while(getchar()!='\n');
for(;flag;)
{
n++;
p1=(Student *)malloc(LEN);
char xueqi[20];
int score[4];
int sum;
struct student *next;
}Student;
int n;
Student *cin(void);
Student *sort_1(Student *head,int);
void sort_2(Student *head);
max_3=min_3=p->score[2];max_2=min_2=p->score[3];
max_sum=min_sum=p->sum;
for(;p;p=p->next)
{
if (max_1<p->score[0]) max_1=p->score[0];
学生信息管理系统C语言源代码

#include<stdio.h>#include<malloc.h>#include<string.h>#include<stdlib.h>#define len sizeof(struct student)FILE *fp;struct student{long num;char name[15];int age;char sex[3];char chushen[10];char dizhi[20];char phone[11];char email[20];struct student *next;};void menu(){printf("===========学生信息管理系统==========\n\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("=====================================\n");}struct student *creat() //录入学生信息{int n;struct student *head;struct student *p1,*p2;n=0;p1=p2=(struct student *) malloc(len);scanf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s",&p1->num,&p1->age,p1->name,p1->sex,p1->chushen ,p1->dizhi,p1->phone,p1->email);head=NULL;while(p1->num!=0){n=n+1;if(n==1) head=p1;else p2->next=p1;p2=p1;p1=(struct student *)malloc(len);scanf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s",&p1->num,&p1->age,p1->name,p1->sex,p1->chu shen,p1->dizhi,p1->phone,p1->email);}p2->next=NULL;return(head);}void insert(struct student *head) //插入学生信息{int search_num;struct student *p,*q,*s;p=head;printf("在哪个学生前插入请输入学号:\n");scanf("%d",&search_num);while((p!=NULL)&&(p->num!=search_num)){q=p;p=p->next;}s=(struct student *)malloc(len);q->next=s;system("cls");printf("请输入学生信息:\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");scanf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s",&s->num,&s->age,s->name,s->sex,s->chushen,s->diz hi,s->phone,s->email);s->next=p;}void printList(struct student *head) //浏览全部学生信息{struct student *p;p=head;if(head==NULL)printf("没有学生信息!!\n");else{do{fread(p,len,1,fp);printf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s\n",p->num,p->age,p->name,p->sex,p->chushen,p->diz hi,p->phone,p->email);p=p->next;}while(p!=NULL);}}void findList_num(struct student *head,long search_num) //按学号查找{struct student *p;p=head;while((p!=NULL)&&(p->num!=search_num))p=p->next;if(p!=NULL)printf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s\n",p->num,p->age,p->name,p->sex,p->chushen,p->diz hi,p->phone,p->email);elseprintf("没有该学生信息!!\n");}void findList_name(struct student *head,char *search_name) //按姓名查找{struct student *p;int cmp1=0,cmp=0;p=head;while(p!=NULL)if(strcmp(p->name,search_name)!=0){p=p->next;cmp++;}else{printf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s\n",p->num,p->age,p->name,p->sex,p->chushen,p->dizhi,p->phone,p->email);p=p->next;cmp1=1;}if(cmp!=0&&cmp1==0)printf("没有该学生信息!!\n");}void xiugai(struct student *p1,long xiu_num) //修改学生信息{struct student *p2;p2=p1;while((p2!=NULL)&&(p2->num!=xiu_num))p2=p2->next;if(p2!=NULL){scanf("%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s",&p2->num,&p2->age,p2->name,p2->sex,p2->chu shen,p2->dizhi,p2->phone,p2->email);}elseprintf("没有该学生信息!!\n");}struct student *delList(struct student *head,long del_num) // 删除学生信息{struct student *p,*q;p=head;q=head;while(p &&(p->num != del_num)){q=p;p=p->next;}if(p==NULL)printf("无此学号!\n");else{if(p == head){head = p->next;free(p);}else{q->next = p->next;free(p);}}return head;}void paixu(struct student *head) //按学号排序{struct student *p,*f,*t;char ch[100];int i;t=f=p=head;for(p=head;p->next!=NULL;p=p->next){for(t=head,f=t->next;t->next!=NULL;t=t->next,f=f->next){if(t->num>f->num>0){i=t->num;t->num=f->num;f->num=i;i=t->age;t->age=f->age;f->age=i;strcpy(ch,t->name);strcpy(t->name,f->name);strcpy(f->name,ch);strcpy(ch,t->sex);strcpy(t->sex,f->sex);strcpy(f->sex,ch);strcpy(ch,t->chushen);strcpy(t->chushen,f->chushen);strcpy(f->chushen,ch);strcpy(ch,t->dizhi);strcpy(t->dizhi,f->dizhi);strcpy(f->dizhi,ch);strcpy(ch,t->phone);strcpy(t->phone,f->phone);strcpy(f->phone,ch);strcpy(ch,t->email);strcpy(t->email,f->email);strcpy(f->email,ch);}}}// return head;}void save(struct student *head) //保存为磁盘文件{struct student *p;if((fp=fopen("keshe","w"))==NULL){printf("cannot open this file\n");exit(0);}p=head;while(p!=NULL){fprintf(fp,"%d\n",p->num);fprintf(fp,"%d\n",p->age);fprintf(fp,"%s\n",p->name);fprintf(fp,"%s\n",p->sex);fprintf(fp,"%s\n",p->chushen);fprintf(fp,"%s\n",p->dizhi);fprintf(fp,"%s\n",p->phone);fprintf(fp,"%s\n",p->email);p=p->next;}fclose(fp);}struct student *read() //从磁盘读取文件{struct student *head=NULL;struct student *p=NULL;struct student *t=NULL;int a;// fp=fopen("keshe","r");if((fp=fopen("keshe","r"))==NULL){printf("cannot open this file\n");exit(0);}while(1){t=(struct student *)malloc(len);a=fscanf(fp,"%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s",&t->num,&t->age,t->name,t->sex,t->chush en,t->dizhi,t->phone,t->email);if(a==0||a==-1)return head;t->next=NULL;if(p==NULL){p=t;head=t;}else{p->next=t;p=p->next;p->next=NULL;}}fclose(fp);}void main(){int code=0;struct student *pt = NULL;while(code!=8){menu();printf("请输入上述序号进行操作:\n");scanf("%d",&code);system("cls");switch(code){case 1:{system("cls");printf("每个学生的信息之间用Tab键分隔\n");printf("===========================录入学生信息==============================\n");printf("---------------------------------------------------------------------\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");pt=creat();save(pt);system("cls");printf("===========================录入学生信息==============================\n");printf("---------------------------------------------------------------------\n");printf("************录入学生信息成功***********!!\n");printf("按回车键返回主菜单\n");getchar();getchar();system("cls");};break;case 2:{system("cls");printf("===========================学生信息表================================\n");printf("---------------------------------------------------------------------\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");pt=read();printList(pt);printf("================================================================ =====\n");printf("---------------------------------------------------------------------\n");printf("\n按回车键返回主菜单\n");getchar();getchar();system("cls");};break;case 3:{int search=0;system("cls");printf("===========================查询学生信息==============================\n");printf("---------------------------------------------------------------------\n");while(search!=3){printf("1、按学号查询\n2、按姓名查询\n3、退出查询\n");scanf("%d",&search);switch(search){case 1:{long search_num;system("cls");printf("请输入学生学号\n");scanf("%d",&search_num);system("cls");printf("===========================查询结果==================================\n");printf("---------------------------------------------------------------------\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");findList_num(read(),search_num);printf("================================================================ =====\n");printf("---------------------------------------------------------------------\n");printf("\n按回车键返回查询菜单\n");getchar();getchar();system("cls");};break;case 2:{char search_name[15];system("cls");printf("请输入学生姓名\n");scanf("%s",search_name);system("cls");printf("===========================查询结果==================================\n");printf("---------------------------------------------------------------------\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");findList_name(read(),search_name);printf("================================================================ =====\n");printf("---------------------------------------------------------------------\n");printf("\n按回车键返回查询菜单\n");getchar();getchar();system("cls");};}}system("cls");};break;case 4:{long del_num;system("cls");printf("===========================删除学生信息==============================\n");printf("---------------------------------------------------------------------\n");printf("请输入要删除学生信息的学号:\n");scanf("%d",&del_num);system("cls");pt=delList(read(),del_num);save(pt);printf("===========================删除结果================================\n");printf("-------------------------------------------------------------------\n");printf("学号为%d的学生信息成功删除\n",del_num);printf("\n按回车键返回主菜单\n");getchar();getchar();system("cls");};break;case 5:{system("cls");printf("每个学生的信息之间用Tab键分隔\n");printf("===========================插入学生信息==============================\n");printf("---------------------------------------------------------------------\n");insert(pt);save(pt);system("cls");printf("===========================插入学生信息==============================\n");printf("---------------------------------------------------------------------\n");printf("****插入学生信息成功***!!\n\n");printf("按回车键返回主菜单\n");getchar();getchar();system("cls");}break;case 6:{long search_num;system("cls");printf("请输入要修改的学生学号:\n");scanf("%d",&search_num);system("cls");printf("每个学生的信息之间用Tab键分隔\n");printf("===========================修改学生信息==================================\n");printf("-------------------------------------------------------------------------\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");findList_num(read(),search_num);printf("\n");printf("请输入修改信息:\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");pt=read();xiugai(pt,search_num);save(pt);printf("================================================================ =====\n");printf("---------------------------------------------------------------------\n");printf("****修改学生信息成功***!!\n\n");printf("\n按回车键返回查询菜单\n");getchar();getchar();system("cls");};break;case 7:{system("cls");printf(" 按学号从小到大排序\n\n");printf("===========================学生信息表================================\n");printf("---------------------------------------------------------------------\n");printf("学号\t年龄\t姓名\t性别\t出生\t地址\t电话\te-mail\n");pt=read();paixu(pt);printList(pt);save(pt);printf("================================================================ =====\n");printf("---------------------------------------------------------------------\n");printf("\n按回车键返回主菜单\n");getchar();getchar();system("cls");};break;case 8:read();break;}}}。
学生管理系统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语言实现线性表的基本操作,能创建一个基于学生信息管理的链表,至少包含数据输入、数据输出、数据处理等操作。
在主函数里能实现以下功能。
运行后出现一个选择提示。
可选择的功能有1)创建新的学生信息链表2)增加一个新的学生信息3)按学号删除某个学生信息4)按学号查找某个学生信息5)可以按照学生成绩对链表排序6)退出系统#include "stdio.h"#include "stdlib.h"#include "string.h"#include "conio.h"jiemian();struct student{char name[50];char sex[5];int age;char num[50];float score1;float score2;float score3;float sum;float ave;}stu[50],del;void gn1(){int i=0;char num1;for(i=0;i<50;i++){printf("请输入要添加的学生资料:\n");printf("学号:");scanf("%s",stu[i].num);printf("姓名:");scanf("%s",stu[i].name);printf("性别:");scanf("%s",&stu[i].sex);printf("年龄:");scanf("%d",&stu[i].age);printf("请输入学生的三门成绩:\n");printf("语文:");scanf("%f",&stu[i].score1);printf("数学:");scanf("%f",&stu[i].score2);printf("英语:");scanf("%f",&stu[i].score3);printf("是否继续添加:y/n\n");scanf("%c",&num1);scanf("%c",&num1);if(num1=='N' || num1=='n'){system("cls");jiemian();}}}void gn2(){int i;char num[50];printf("请输入要查找的学生学号:\n");scanf("%s",num);for(i=0;i<50;i++)if(strcmp(stu[i].num,num)==0){stu[i].sum=stu[i].score1+stu[i].score2+stu[i].score3;stu[i].ave=stu[i].sum/3;printf("%s\t%s\t%s\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f:\n",stu[i].num,stu[i].name,stu[i].sex,stu[i] .age,stu[i].score1,stu[i].score2,stu[i].score3,stu[i].sum,stu[i].ave);break;}if(i==50)printf("查找不到!请重新输入!\n");getch();system("cls");jiemian();}void gn3(){char num1,i=0;printf("请输入要修改的学生学号:\n");scanf("%s",stu[i].num);printf("%s\t%s\t%s\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f:\n",stu[i].num,stu[i].name,stu[i].sex,stu[i] .age,stu[i].score1,stu[i].score2,stu[i].score3,stu[i].sum,stu[i].ave);printf("姓名:");scanf("%s",stu[i].name);printf("性别:");scanf("%s",stu[i].sex);printf("年龄:");scanf("%d",&stu[i].age);printf("请输入学生的三门成绩:\n");printf("语文:");scanf("%f",&stu[i].score1);printf("数学:");scanf("%f",&stu[i].score2);printf("英语:");scanf("%f",&stu[i].score3);printf("是否继续修改:y/n?\n");scanf("%c",&num1);scanf("%c",&num1);if(num1=='N' || num1=='n')system("cls");jiemian();}void gn4(){int i;char num[50];printf("请输入要删除的学生学号:\n");scanf("%s",num);for(i=0;i<50;i++)if(strcmp(num,stu[i].num)==0){printf("%s\t%s\t%s\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f:\n",stu[i].num,stu[i].name,stu[i].sex,stu[i] .age,stu[i].score1,stu[i].score2,stu[i].score3,stu[i].sum,stu[i].ave);stu[i]=del;printf("信息已删除,按任意键返回..\n");break;}if(i==50)printf("您输入的信息不存在!\n");getch();system("cls");jiemian();}void gn5(){int i=0;stu[i].sum=stu[i].score1+stu[i].score2+stu[i].score3;stu[i].ave=stu[i].sum/3;printf("学号\t姓名\t性别\t年龄\t语文\t数学\t英语\t总成绩\t 平均成绩\n"); for(i=0;i<50;i++){if(stu[i].age==0)break;printf("%s\t%s\t%s\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f:\n",stu[i].num,stu[i].name,stu[i].sex,stu[i] .age,stu[i].score1,stu[i].score2,stu[i].score3,stu[i].sum,stu[i].ave);}printf("按任意键返回...");getch();system("cls");jiemian();}void gn6(){FILE *fp;int i;char filename[50];printf("\n");printf("\n");printf("请输入要保存的文件名:");scanf("%s",filename);if((fp=fopen(filename,"wb"))==NULL)printf("文件名为空,不能保存!\n");for(i=0;i<50;i++){if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1)printf("文件保存失败!\n");}fclose(fp);printf("文件已保存!\n");printf("按任意键返回...\n");getch();system("cls");jiemian();}void gn7(){FILE *fp;int i=0; //打开文件流char filename[50];printf("请输入文件名:");scanf("%s",filename); //输入要载入的文件名if((fp=fopen(filename,"rb"))==0) //如果当前目录下不存在相对应的文件,输出文件不存在,退出系统。
学生成绩管理系统c语言代码(供参考)

C程序学生管理系统以下是用c语言编写的学生成绩管理系统的简单代码,可以用vc运行(供参考) #include"stdio.h"#include”stdlib。
h"#include"string。
h”typedef struct student//定义学生{char name[10];int number;char sex[2];int math;int eglish;int clanguge;int average;}student;typedef struct unit//定义接点{student date;struct unit *next;}unit;unit* build()//建立链表并返回指针{unit *p;if((p=(unit*)malloc(sizeof(unit)))==NULL){ printf("=>初始化失败!”);return 0;}else{p—>next=NULL;p-〉date.number=0;//头结点存放学生人数printf("初始化成功!\n");return p;}}void add(unit *head)//增加学生{unit *p,*q;int m,n=0;q=head-〉next;p=(unit*)malloc(sizeof(unit));printf(”=〉请输入新生姓名!\n");gets(p—>);fflush(stdin);printf("=〉请输入学号!\n");while(n==0){scanf("%d",&m);fflush(stdin);if(q==NULL) n=1;while(q){if(q->date.number==m){printf("=>你输入的学号与已有同学的学号相同,请重新输入!\n");q=head-〉next;break;}else{q=q->next;if(q==NULL) n=1;}}}p—〉date。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
c大作业学生信息管理系统源代码
学生信息管理系统源代码:
#include<iostream.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include<iomanip.h>
#include<fstream.h>
struct student
{
char num[30]; int maths;
char name[30]; int chinese;
char clas[30]; int english;
int total; float average;
student *next;
};
//◆1(1)
void createlist(student * & head) //学生成绩文件导入功能(用链表储存)
{
char t[80],num0[30],name0[30],clas0[30];
int chinese0,maths0,english0;
student *s,*p;
ifstream instuf("student-score.txt",ios::in);
if (!instuf) {cerr<<"file could not be open."<<endl; abort();}
instuf.getline(t,80);
while
(instuf>>num0>>name0>>clas0>>chinese0>>maths0>>english0)
{
s=new student;
strcpy(s->num,num0);strcpy(s->name,name0);strcpy(s-
>clas,clas0);
s->chinese=chinese0;s->maths=maths0;s->english=english0; s->total=s->chinese+s->maths+s->english; s->average=float(s->total)/3;
if (head==NULL) head=s;
else p->next=s;
p=s;
}
p->next=NULL;
instuf.close();
}
//◆1(2)
void showlist(student *head) //学生成绩信息显示功能(遍历链表)
{
int n=1;
cout<<"学号姓名班级语文数学英语总分均分序号 ";
while (head)
{
cout<<head->num<<" "<<head->name<<'\t'<<head->clas<<'\t'<<" "<<head->chinese<<'\t'
<<head->maths<<'\t'<<head->english<<'\t'<<head-
>total<<'\t'<<setprecision(3)<<head->average<<'\t'<<" "<<n<<endl;
n=n+1;
head=head->next;
}
}
//◆2
void charu(student *head) //学生成绩信息插入功能(链表尾部插入学生成绩信息)
{
student *s,*p,*q;
int n,i;
cout<<"请输入需要【插入】的学生成绩信息的数量: ";
cin>>n;
cout<<"请输入需插入的学生成绩信息(每人一行):"<<endl;
cout<<"学号姓名班级语文数学英语"<<endl;
p=head;
while (p)
{
q=p;
p=p->next;
}
for (i=1;i<=n;i++)
{
s=new student;
cin>>s->num>>s->name>>s->clas>>s->chinese>>s->maths>>s->english;
s->total=s->chinese+s->maths+s->english; s-
>average=float(s->total)/3;
q->next =s;
q=s;
}
q->next=NULL;
}
//◆3
void shanchu(student * & head) //学生成绩信息删除功能
{
student *p,*q;
char a[30];
int n,i,b=1;
cout<<"请输入需【删除】的学生成绩信息的数量: ";
cin>>n;
cout<<"请输入需要删除的学生的学号或姓名:"<<endl;
for (i=1;i<=n;i++)
{
cin>>a;
if ((strcmp(head->num,a)==0)||(strcmp(head->name,a)==0)) {。