欢迎来到天天文库
浏览记录
ID:61499017
大小:54.00 KB
页数:13页
时间:2021-02-07
《C语言课程设计——学生管理系统源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、C语言课程设计——学生管理系统源代码#include#include#include#include#defineMY1printf("学号t姓名t性别t年龄t生日")#defineMY2printf("%d%6s%4st%2d%8d%2d%2d",s[i].num,s[i].name,s[i].sex,s[i].age,s[i].a.year,s [i].a.month,s[i].a.day)#defineMY3printf("家庭住址联系方
2、式高数英语大物总成绩")#defineMY4printf("%4s%4s%2d%2d%2d%2d",s[i].address,s[i].tel,s[i].c.gao,s[i].c.ying,s [i].c.wu,s[i].c.total)#defineMAX30inti;intsum;/*时间结构体类型*/structdate{intyear;intmonth;intday;}a;/*学生成绩结构体类型*/structscore{intgao;intying;intwu;inttotal;}c;/*学生信息结构体类型*/stru
3、cts_message{intnum;charname[20];charsex[5];intage;structdatea;charaddress[50];chartel[11];structscorec;}s[MAX];/*保存学生信息模块*/voidsave_message(intsum){inti;FILE*fp;if((fp=fopen("D:\s.txt","wb"))==NULL){printf("readingfileiswrong!");return;}for(i=0;i4、[i],sizeof(structs_message),1,fp)!=1)printf("writingfileiswrong!");}fclose(fp);}/*读取学生信息模块*/intread_message(){FILE*fp;inti=0;if((fp=fopen("D:\s.txt","rb"))==NULL){printf("***********暂时无任何库存信息,按回车键进入主菜单选择基本信息的录入!***********");return0;}while(feof(fp)==0){if(fread(5、&s[i],sizeof(structs_message),1,fp)!=1)break;i++;}fclose(fp);return(i);}/*输入学生信息模块*/putin_message(){system("cls");inti=0,m=0;printf("***********输入学生信息****************");printf("输入要输入的学生的个数(m6、i+1);printf("学生学号:");scanf("%d",&s[i].num);if(s[i].num==0)break;printf("学生姓名:");scanf("%s",s[i].name);printf("学生性别:");scanf("%s",s[i].sex);printf("学生年龄:");scanf("%d",&s[i].age);printf("学生生日:");scanf("%d%d%d",&s[i].a.year,&s[i].a.month,&s[i].a.day);printf("家庭住7、址:");scanf("%s",s[i].address);printf("联系方式:");scanf("%s",s[i].tel);printf("高数--英语--大物(成绩0-100):");scanf("%d%d%d",&s[i].c.gao,&s[i].c.ying,&s[i].c.wu);s[i].c.total=s[i].c.gao+s[i].c.ying+s[i].c.wu;flushall();}printf("***********************学生信息输入完毕******************8、****");sum+=m;printf("按回车键返回主菜单!");getch();return0;}/*输出学生信息模块*/voidputout_message(){system("cls");
4、[i],sizeof(structs_message),1,fp)!=1)printf("writingfileiswrong!");}fclose(fp);}/*读取学生信息模块*/intread_message(){FILE*fp;inti=0;if((fp=fopen("D:\s.txt","rb"))==NULL){printf("***********暂时无任何库存信息,按回车键进入主菜单选择基本信息的录入!***********");return0;}while(feof(fp)==0){if(fread(
5、&s[i],sizeof(structs_message),1,fp)!=1)break;i++;}fclose(fp);return(i);}/*输入学生信息模块*/putin_message(){system("cls");inti=0,m=0;printf("***********输入学生信息****************");printf("输入要输入的学生的个数(m6、i+1);printf("学生学号:");scanf("%d",&s[i].num);if(s[i].num==0)break;printf("学生姓名:");scanf("%s",s[i].name);printf("学生性别:");scanf("%s",s[i].sex);printf("学生年龄:");scanf("%d",&s[i].age);printf("学生生日:");scanf("%d%d%d",&s[i].a.year,&s[i].a.month,&s[i].a.day);printf("家庭住7、址:");scanf("%s",s[i].address);printf("联系方式:");scanf("%s",s[i].tel);printf("高数--英语--大物(成绩0-100):");scanf("%d%d%d",&s[i].c.gao,&s[i].c.ying,&s[i].c.wu);s[i].c.total=s[i].c.gao+s[i].c.ying+s[i].c.wu;flushall();}printf("***********************学生信息输入完毕******************8、****");sum+=m;printf("按回车键返回主菜单!");getch();return0;}/*输出学生信息模块*/voidputout_message(){system("cls");
6、i+1);printf("学生学号:");scanf("%d",&s[i].num);if(s[i].num==0)break;printf("学生姓名:");scanf("%s",s[i].name);printf("学生性别:");scanf("%s",s[i].sex);printf("学生年龄:");scanf("%d",&s[i].age);printf("学生生日:");scanf("%d%d%d",&s[i].a.year,&s[i].a.month,&s[i].a.day);printf("家庭住
7、址:");scanf("%s",s[i].address);printf("联系方式:");scanf("%s",s[i].tel);printf("高数--英语--大物(成绩0-100):");scanf("%d%d%d",&s[i].c.gao,&s[i].c.ying,&s[i].c.wu);s[i].c.total=s[i].c.gao+s[i].c.ying+s[i].c.wu;flushall();}printf("***********************学生信息输入完毕******************
8、****");sum+=m;printf("按回车键返回主菜单!");getch();return0;}/*输出学生信息模块*/voidputout_message(){system("cls");
此文档下载收益归作者所有