C语言写的学生成绩管理系统(链表)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
back();
break;
case '3':
insert(&head);
output(head);
back();
break;
case '4':
delet(&head);
output(head);
back();
break;
case '5':
good(head);
back();
break;
case '6':
p=p->next;
}
printf("\n");
}
void binsearch(struct studcode *head)
{
struct studHale Waihona Puke Baiduode *p;
int k=1;
long x;
p=head;
printf("请输入需要查找的学生的学号:");
scanf("%ld",&x);
printf("\n");
p->student.zf=p->student.sx+p->student.dx+p->student.ts+p->student.dl+p->student.cx;
p->student.pj=p->student.zf/5;
p->next=*headp;
*headp=p;
}
}
void output(struct studcode *head)
printf(" \n 2.查找某学号的学生信息\n");
printf(" \n 3.插入某学生的信息\n");
printf(" \n 4.删除某学号学生的信息\n");
printf(" \n 5.统计各门课程成绩在90分以上学生所占百分比\n");
printf(" \n 6.统计各门课程成绩在60分以下学生所占百分比\n");
void insert(struct studcode **);
void delet(struct studcode **);
void good(struct studcode *);
void fail(struct studcode *);
void sort(struct studcode *);
{
struct studcode *p;
p=head;
printf("学号\t姓名\t高数\t读写\t听说\t导论\t程序\t总分\t平均分\n");
while(p!=NULL){
printf("%-ld\t%-4s\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\n",p->student.num,p->student.name,p->student.sx,p->student.dx,p->student.ts,p->student.dl,p->student.cx,p->student.zf,p->student.pj);
while(p!=NULL){
if(p->student.num==x)
{
struct studcode *p;
while(1)
{
p=(struct studcode *)malloc(sizeof(struct studcode));
scanf("%ld",&p->student.num);
if(p->student.num==0) break;
scanf("%s%f%f%f%f%f",&p->student.name,&p->student.sx,&p->student.dx,&p->student.ts,&p->student.dl,&p->student.cx);
while (flag)
{
system("cls");
menu();
printf("请选择:");
getchar();
choose=getchar();
switch(choose)
{
case '1':
output(head);
back();
break;
case '2':
binsearch(head);
printf(" \n 7.按总分降序排序,依高低排出名次\n");
printf(" \n 0.退出\n\n");
}
void back()
{
int x;
printf("\n");
do{
printf("按1返回菜单界面:");
scanf("%d",&x);
}while(x!=1);
}
void input(struct studcode **headp)
break;
default: printf("\n Wrong Selection !(选择错误,请重选)\n");
back();
}
}
}
void menu()
{
printf(" \n学生成绩统计与分析系统\n");
printf(" \n菜单\n\n");
printf(" \n 1.显示所有学生的信息\n");
fail(head);
back();
break;
case '7':
sort(head);
output(head);
back();
break;
case '0':
flag=0;
printf("\n *** The End! ***\n");
printf("\n ####感谢使用,欢迎再次登录,拜拜!####\n");
void back();
void main()
{
char choose;
int flag=1;
struct studcode *head;
head=NULL;
printf("请先录入学生成绩信息\n");
printf("输入学生学号姓名高数、英语读写、英语听说、计算机导论和程序设计的成绩\n");
input(&head);
};
struct studcode{
struct stud student;
struct studcode *next;
};
void menu();
void input(struct studcode **);
void output(struct studcode *);
void binsearch(struct studcode *);
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct stud{
long num;
char name[20];
float sx;
float dx;
float ts;
float dl;
float cx;
float zf;
float pj;
break;
case '3':
insert(&head);
output(head);
back();
break;
case '4':
delet(&head);
output(head);
back();
break;
case '5':
good(head);
back();
break;
case '6':
p=p->next;
}
printf("\n");
}
void binsearch(struct studcode *head)
{
struct studHale Waihona Puke Baiduode *p;
int k=1;
long x;
p=head;
printf("请输入需要查找的学生的学号:");
scanf("%ld",&x);
printf("\n");
p->student.zf=p->student.sx+p->student.dx+p->student.ts+p->student.dl+p->student.cx;
p->student.pj=p->student.zf/5;
p->next=*headp;
*headp=p;
}
}
void output(struct studcode *head)
printf(" \n 2.查找某学号的学生信息\n");
printf(" \n 3.插入某学生的信息\n");
printf(" \n 4.删除某学号学生的信息\n");
printf(" \n 5.统计各门课程成绩在90分以上学生所占百分比\n");
printf(" \n 6.统计各门课程成绩在60分以下学生所占百分比\n");
void insert(struct studcode **);
void delet(struct studcode **);
void good(struct studcode *);
void fail(struct studcode *);
void sort(struct studcode *);
{
struct studcode *p;
p=head;
printf("学号\t姓名\t高数\t读写\t听说\t导论\t程序\t总分\t平均分\n");
while(p!=NULL){
printf("%-ld\t%-4s\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\t%-0.2f\n",p->student.num,p->student.name,p->student.sx,p->student.dx,p->student.ts,p->student.dl,p->student.cx,p->student.zf,p->student.pj);
while(p!=NULL){
if(p->student.num==x)
{
struct studcode *p;
while(1)
{
p=(struct studcode *)malloc(sizeof(struct studcode));
scanf("%ld",&p->student.num);
if(p->student.num==0) break;
scanf("%s%f%f%f%f%f",&p->student.name,&p->student.sx,&p->student.dx,&p->student.ts,&p->student.dl,&p->student.cx);
while (flag)
{
system("cls");
menu();
printf("请选择:");
getchar();
choose=getchar();
switch(choose)
{
case '1':
output(head);
back();
break;
case '2':
binsearch(head);
printf(" \n 7.按总分降序排序,依高低排出名次\n");
printf(" \n 0.退出\n\n");
}
void back()
{
int x;
printf("\n");
do{
printf("按1返回菜单界面:");
scanf("%d",&x);
}while(x!=1);
}
void input(struct studcode **headp)
break;
default: printf("\n Wrong Selection !(选择错误,请重选)\n");
back();
}
}
}
void menu()
{
printf(" \n学生成绩统计与分析系统\n");
printf(" \n菜单\n\n");
printf(" \n 1.显示所有学生的信息\n");
fail(head);
back();
break;
case '7':
sort(head);
output(head);
back();
break;
case '0':
flag=0;
printf("\n *** The End! ***\n");
printf("\n ####感谢使用,欢迎再次登录,拜拜!####\n");
void back();
void main()
{
char choose;
int flag=1;
struct studcode *head;
head=NULL;
printf("请先录入学生成绩信息\n");
printf("输入学生学号姓名高数、英语读写、英语听说、计算机导论和程序设计的成绩\n");
input(&head);
};
struct studcode{
struct stud student;
struct studcode *next;
};
void menu();
void input(struct studcode **);
void output(struct studcode *);
void binsearch(struct studcode *);
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct stud{
long num;
char name[20];
float sx;
float dx;
float ts;
float dl;
float cx;
float zf;
float pj;