ImageVerifierCode 换一换
格式:DOCX , 页数:26 ,大小:21.78KB ,
资源ID:16329977      下载积分:1 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-16329977.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C语言课程设计学生成绩管理系统.docx)为本站会员(b****7)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

C语言课程设计学生成绩管理系统.docx

1、C语言课程设计学生成绩管理系统include ”stdio.h”include string.hinclude stdlib.hinclude ”conio.hinclude ”string.h”#include fcntl。htypedef struct student int num; char grade10; char classroom10; char name10; float score_math; float score_chinese; float score_english; float average; float sum;STU;typedef struct Node

2、STU data; struct Node next;*linklist;void menu();char loginpassword(char password,int n);/登录验证密码函数声明/linklist createstulist(linklist head); /创建学生链表即学生信息录入函数声明/void printstulist(linklist head); /学生信息输出函数声明/void searchstu_namelist(linklist head); /学生信息查询函数声明(按姓名)/void searchstu_numlist(linklist head);

3、 /学生信息查询函数声明(按学号)linklist modifystulist(linklist head); /学生信息修改函数声明/linklist delatestulist(linklist head); /学生信息删除函数声明/void savestulist(linklist head); /学生信息保存到文件函数声明/linklist loadstulist(); /从文件中读取学生信息函数声明/void sortstulist(linklist head); /成绩排名函数(按年级)声明/void sort(STU stu,int flag); /学生分班函数声明/void s

4、ortstuclass(linklist head); /成绩排名函数(按班级)声明/*/void main() char admin=”zhangqiong; char password=”123456”; char person20; char password110; int i; int j=0; printf(”*n); printf(tt *欢迎来到学生成绩管理系统*nn”); printf(*nn”); printf(tttt用 户 登 录nnnn); for(i=0;i3;i+) printf(用 户 名: ); gets(person); fflush(stdin); pri

5、ntf(”nnn”); loginpassword(password1,10); printf(nnn”); if(strcmp(admin,person)=0&strcmp(password,password1)=0) printf(”tttt成功登录,亲!n); printf(nn”); printf(”按任意键继续!”); getch(); menu(); break; else printf(t用户名或者密码输入错误n); if(i=3) printf(”t对不起,您今天输入次数太多,已被强制退出!n”);/*/*/ char *loginpassword(char password,

6、int n) /登录密码函数,隐藏密码可见/ int i=0; int m=0; char ch; printf(”用户密码:”); while(ch=getch())!=rmdata。num); printf(”请输入姓名:n”); scanf(s,pdata。name); printf(请输入年级:n”); scanf(”s,p-data.grade); printf(请输入班级:n”); scanf(s”,&pdata.classroom); printf(请输入数学成绩:n”); scanf(”f,&pdata。score_math); while(pdata。score_math10

7、0) printf(成绩超过100了,你是猪吗?n); printf(”给老子重新输入:n”); scanf(f,&p-data。score_math); printf(请输入语文成绩:n”); scanf(”f,pdata.score_chinese); while(p-data.score_chinese100) printf(”成绩超过100了,你是猪吗?n); printf(给老子重新输入:n”); scanf(%f,&pdata.score_chinese); printf(”请输入英语成绩:n”); scanf(f”,pdata。score_english); while(pdat

8、a。score_english100) printf(”成绩超过100了,你是猪吗?n); printf(给老子重新输入:n”); scanf(f”,p-data。score_english); p-data.sum=p-data.score_math+p-data。score_chinese+p-data。score_english; p-data.average=pdata。sum/3; qnext=p; q=p; q-next=NULL; printf(”是否要输入下一个学生的信息(Y/N)!”); fflush(stdin); ch=getchar(); system(”cls); w

9、hile(ch=Y|ch=y); return(L);/*/void printstulist(linklist L) /输出信息函数/ linklist p; p=Lnext; if(p=NULL) printf(请先录入学生信息,亲!n); else while(p!=NULL) printf(”学号 姓名 年级 班级 数学成绩 语文成绩 英语成绩 总分 平均成绩n); printf(”%6d 3s %2s %2s %4.1f %4。1f %4.1f 4.1f 4.1fn”,p-data.num,pdata。name,pdata.grade,pdata.classroom,pdata.sc

10、ore_math,pdata。score_chinese,pdata.score_english,p-data。sum,pdata。average); p=p-next; printf(按任意键继续n”); getch(); system(”cls);/*/void searchstu_namelist(linklist L) /按姓名查询函数/ linklist p; char str10; printf(请输入要查询的学生姓名:n”); scanf(”%s,str); p=Lnext; if(p=NULL) printf(请先录入学生信息n”); while(p!=NULL) if(str

11、cmp(p-data.name,str)=0) printf(学号 姓名 年级 班级 数学成绩 语文成绩 英语成绩 总分 平均成绩n”); printf(6d %3s 2s 2s %4。1f 4。1f %4。1f %4。1f %4。1fn,pdata.num,pdata.name,pdata。grade,p-data。classroom,pdata.score_math,pdata。score_chinese,p-data.score_english,p-data。sum,pdata。average); p=p-next; printf(按任意键继续n); getch(); system(cl

12、s);/*/void searchstu_numlist(linklist L) /按学号查询函数/ linklist p; int number; printf(”请输入要查询的学生学号:n”); scanf(%d,&number); p=L-next; if(p=NULL) printf(请先录入学生信息n); while(p!=NULL) if(pdata。num=number) printf(”学号 姓名 年级 班级 数学成绩 语文成绩 英语成绩 总分 平均成绩n); printf(%6d %3s 2s %2s 4.1f %4。1f %4。1f %4.1f %4.1fn,pdata。n

13、um,pdata。name,pdata。grade,p-data。classroom,p-data。score_math,p-data.score_chinese,p-data.score_english,p-data.sum,pdata。average); p=pnext; printf(按任意键继续n); getch(); system(cls”); /*/ linklist delatestulist(linklist L) /删除信息函数/ linklist p,q; int number; char ch; printf(请输入要删除的学生学号:n”); scanf(d,&numbe

14、r); p=L-next; if(p=NULL) printf(请先录入学生信息n”); return NULL; while(p!=NULL) if(p-data。num=number) printf(”学号 姓名 年级 班级 数学成绩 语文成绩 英语成绩 总分 平均成绩n”); printf(6d %3s 2s %2s 4。1f 4.1f 4.1f %4。1f 4。1fn,pdata。num,pdata。name,p-data.grade,pdata.classroom,p-data。score_math,p-data。score_chinese,p-data。score_english,

15、p-data。sum,p-data。average); printf(”确定要删除该学生的信息吗?(Y/N)n”); fflush(stdin); ch=getchar(); if(ch=Y|ch=y) q=L; while(q-next!=p) q=q-next; if(q-next=p) if(pnext=NULL) q-next=NULL; else q-next=p-next; free(p); printf(已删除该学生的相关信息!n); return(L); else return NULL; else p=pnext; printf(按任意键继续n); getch(); syst

16、em(”cls); /*/ void savestulist(linklist L) /存盘函数/ FILE *fp; linklist p; char outfile20; printf(请输入你要保存信息的文件名:(例如:D:学生管理系统student.text)n); scanf(s,outfile); if(fp=fopen(outfile,w”))=NULL) printf(文件打开失败n”); exit(1); p=L; while(p!=NULL) fwrite(p,sizeof(Node),1,fp); p=pnext; fclose(fp); printf(”信息保存成功!n

17、”); printf(”请按任意键继续n); getch(); system(”cls); /*/ linklist loadstulist() /读盘函数/ linklist q,p,L; L=NULL; FILE *fp; char infile20; printf(请输入要打开的文件名:n”); scanf(%s”,infile); if((fp=fopen(infile,”rb))=NULL) printf(”文件打开失败!n”); exit(1); printf(正在打开文件.。n”); p=(linklist)malloc(sizeof(Node); if(!p) printf(无

18、法申请到内存空间); return L; L=p; while(!feof(fp)) if(fread(p,sizeof(Node),1,fp)!=1) printf(”读取信息失败!n); break; pnext=(linklist)malloc(sizeof(Node)); if(!pnext) printf(”无法申请到内存空间); return L; q=p; p=p-next; q-next=NULL; fclose(fp); printf(读取成功!n); return L; /*/ void sortstulist(linklist L) /年级排序函数/ STU stu100

19、0; int i=0; int flag=0; linklist p; p=L-next; if(p=NULL) printf(”请先录入学生信息,亲!n); while(p!=NULL&i1000) stui=p-data; i+; p=pnext; flag+; printf(”正在排序。.。n”); sort(stu, flag); /*/ void sort(STU stu,int flag) int i,j; STU temp; for(i=1;iflag;i+) for(j=0;jflagi;j+) if(stuj.sumstuj+1.sum) temp=stuj; stuj=st

20、uj+1; stuj+1=temp; printf(学号 姓名 年级 班级 数学成绩 语文成绩 英语成绩 总分 平均成绩n”); for(i=flag1;i=0;i-) printf(”6d 3s 2s %2s %4。1f 4。1f %4。1f 4.1f 4。1fn”,stui.num,stui。name,stui。grade,stui。classroom,stui。score_math,stui.score_chinese,stui。score_english,stui.sum,stui。average); printf(按任意键继续!n); getch(); system(”cls”); /*/void sortstuclass(linklist L) /班级排序函数/ STU stu1000; int i=0; STU c1100,c2100,c3100,c4100,c5100,c6100,c7100,c8100; int flag=0,flag1=0,flag2=0,flag3=0,flag4=0,

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2