C语言学生信息管理系统项目源码EnjoyLifeXK

#include//包含printf()、scanf()、gets()、puts()、getchar()函数#include//包含malloc()函数#include//包含strcmp()、strlen()、sizeof()、strcpy()函数#include//包含system()、sleep()函数#include//包含exit()函数

#definearrSize256

#definesleepTime50

voidfullScreen(){HWNDhwnd=GetForegroundWindow();intx=GetSystemMetrics(SM_CXSCREEN)+300,y=GetSystemMetrics(SM_CYSCREEN)+300;charsetting[30];//设置控制台行列数sprintf(setting,"modecon:cols=%dlines=%d",x,y);system(setting);//置顶SetWindowPos(hwnd,HWND_TOPMOST,0,0,x+200,y+200,NULL);//移动MoveWindow(hwnd,-5,-20,x+200,y+200,1);printf("\n\n");}

voidwait(){for(inti=0;i<24;i++){Sleep(sleepTime);printf(".");}puts("\n");}

voidhello(){for(inti=0;i<5;i++){Sleep(sleepTime);printf("X");}

Sleep(sleepTime);printf("");Sleep(sleepTime);printf("欢");Sleep(sleepTime);printf("迎");Sleep(sleepTime);printf("来");Sleep(sleepTime);printf("到");Sleep(sleepTime);printf("学");Sleep(sleepTime);printf("生");Sleep(sleepTime);printf("信");Sleep(sleepTime);printf("息");Sleep(sleepTime);printf("管");Sleep(sleepTime);printf("理");Sleep(sleepTime);printf("系");Sleep(sleepTime);printf("统");Sleep(sleepTime);printf("");

for(intk=0;k<5;k++){Sleep(sleepTime);printf("X");}puts("\n");}

voidcheckUsernamePassword(){charusername[]="xinke",username0[arrSize];charpassword[]="2016",password0[arrSize];for(inti=1;i<4;i++){printf("请输入用户名:");gets(username0);if(strcmp(username,username0)!=0){puts("用户名错误!");printf("3次输入错误将退出程序,错误%d次!\n\n",i);if(i==3){printf("程序即将退出");wait();system("cls");//调用倒计时函数countBackwards();}}else{i=3;puts("用户名正确!\n");for(inta=1;a<4;a++){printf("请输入密码:");gets(password0);if(strcmp(password,password0)!=0){puts("密码错误!");printf("3次输入错误将退出程序,错误%d次!\n\n",a);if(a==3){puts("程序即将退出");wait();system("cls");//调用倒计时函数fcountBackwards();break;}}else{a=3;printf("密码正确,即将进入程序");wait();system("cls");}}}}}

voidmenu(){puts("::::::请输入您要选择的操作编码::::::");puts("1.添加新学生的信息");puts("2.根据学号查找学生信息功能");puts("3.根据姓名查找学生信息功能");puts("4.根据学号修改学生信息功能");puts("5.根据学号删除学生信息功能");puts("6.根据姓名删除学生信息功能");puts("7.输入0退出");puts("::::::::::::::::::::::::::::::::::::");}

structstudent*next;};

staticstructstudent*head=NULL;

structstudent*createStudent(intnum,charname[arrSize],charbirthday[arrSize],charsex[arrSize],charadress[arrSize],charphone[arrSize],structstudent*next){structstudent*tmp;tmp=(structstudent*)malloc(sizeof(structstudent));tmp->num=num;strcpy(tmp->name,name);strcpy(tmp->birthday,birthday);strcpy(tmp->sex,sex);strcpy(tmp->adress,adress);strcpy(tmp->phone,phone);

tmp->next=next;

returntmp;}

voidaddStudent(intnum,charname[arrSize],charbirthday[arrSize],charsex[arrSize],charadress[arrSize],charphone[arrSize]){structstudent*tmp=head->next;structstudent*tmp1=head;structstudent*newnode=createStudent(num,name,birthday,sex,adress,phone,NULL);while(tmp!=NULL){if(tmp->num>=num){newnode->next=tmp;tmp1->next=newnode;break;}tmp1=tmp1->next;tmp=tmp->next;}if(tmp==NULL){tmp1->next=newnode;}}

voidfindStudentFromNum(intnum){structstudent*tmp=head->next;intflag1;while(tmp!=NULL){if(tmp->num==num){flag1=1;system("cls");puts("恭喜您!找到了该学生,信息如下:\n学号\t姓名\t出生日期\t性别\t家庭地址\t联系方式");printf("%d\t%s\t%s\t%s\t%s\t\t%s\n\n",tmp->num,tmp->name,tmp->birthday,tmp->sex,tmp->adress,tmp->phone);break;}tmp=tmp->next;}if(flag1!=1){puts("系统中不存在该学生的信息!");}}

voidfindStudentFromName(charname[arrSize]){structstudent*tmp=head->next;intflag2;while(tmp!=NULL){if(strcmp(tmp->name,name)==0){flag2=1;system("cls");puts("恭喜您!找到了该学生,信息如下:\n学号\t姓名\t出生日期\t性别\t家庭地址\t联系方式");printf("%d\t%s\t%s\t%s\t%s\t\t%s\n\n",tmp->num,tmp->name,tmp->birthday,tmp->sex,tmp->adress,tmp->phone);break;}tmp=tmp->next;}if(flag2!=1){puts("系统中不存在该学生的信息!");}}

voidmodifyStudentFromNum(intnum,charname[arrSize],charbirthday[arrSize],charsex[arrSize],charadress[arrSize],charphone[arrSize]){structstudent*tmp=head->next;while(tmp!=NULL){if(tmp->num==num){strcpy(tmp->name,name);strcpy(tmp->birthday,birthday);strcpy(tmp->sex,sex);strcpy(tmp->adress,adress);strcpy(tmp->phone,phone);break;}tmp=tmp->next;}}

voiddeleteStudentFromNum(intnum){structstudent*tmp=head->next;structstudent*tmp1=head;while(tmp!=NULL){if(tmp->num==num){tmp1->next=tmp->next;free(tmp);break;}tmp=tmp->next;tmp1=tmp1->next;}}

voiddeleteStudentFromName(charname[arrSize]){structstudent*tmp=head->next;structstudent*tmp1=head;while(tmp!=NULL){if(strcmp(tmp->name,name)==0){tmp1->next=tmp->next;free(tmp);break;}tmp=tmp->next;tmp1=tmp1->next;}}

voidprintList(){structstudent*tmp;tmp=head->next;

puts("学号\t姓名\t出生日期\t性别\t家庭地址\t联系方式");while(tmp){printf("%d\t%s\t%s\t%s\t%s\t\t%s\n",tmp->num,tmp->name,tmp->birthday,tmp->sex,tmp->adress,tmp->phone);tmp=tmp->next;}}

voidfreeList(){structstudent*tmp=head;structstudent*tmp1;while(tmp){tmp1=tmp;tmp=tmp->next;free(tmp1);}}

voidexitPrograms(){system("cls");printf("请输入0退出程序:");exit(getch());}

intx;

intcheckNumNoSame(){structstudent*tmp=head->next;

while(1){if(tmp==NULL){returnx;}if(tmp->num==x){printf("已存在该学号,请重新输入!\n\n");checkNumStrlen();break;}tmp=tmp->next;}}

intmain(void){fullScreen();//调用全屏函数

system("color0C");//背景为黑色,前景为淡红色

checkUsernamePassword();//验证用户名和密码

printf("系统正在初始化,请稍候");wait();//稍候效果......system("cls");system("color0A");for(inti=50000;i>=0;i--){printf("%d",rand());Sleep(0.000001);}system("cls");

hello();//动态显示欢迎信息

system("color0A");//背景为黑色,前景为淡绿色

menu();//打印菜单栏structstudent*stu1;structstudent*stu2;structstudent*stu3;structstudent*stu4;structstudent*tmp;

stu1=createStudent(201601,"Alan","1997-09-15","女","墨西哥","13871745572",NULL);stu2=createStudent(201602,"Bobo","1994-08-25","男","亚马逊","0710-1452637",NULL);stu3=createStudent(201603,"John","1996-02-23","男","莫斯科","13476320757",NULL);stu4=createStudent(201604,"Cici","1995-11-12","女","太平洋","0710-4567894",NULL);head=(structstudent*)malloc(sizeof(structstudent));head->num=-1;head->next=NULL;

head->next=stu1;stu1->next=stu2;stu2->next=stu3;stu3->next=stu4;stu4->next=NULL;FILE*fp;structstudenttmps;structstudent*tmp_head;fp=fopen("student.txt","rt");if(fp==NULL){perror("fopen");return-1;}tmp_head=head;memset(&tmps,0,sizeof(structstudent));while(fread(&tmps,sizeof(structstudent),1,fp)>0){tmp_head->next=createStudent(tmps.num,tmps.name,tmps.birthday,tmps.sex,tmps.adress,tmps.phone,NULL);tmp_head=tmp_head->next;memset(&tmps,0,sizeof(structstudent));}fclose(fp);intnum;chartemp[arrSize]={0};//用于以字符串形式接收的学号成员转换为int类型的中间变量charname[arrSize]={0},birthday[arrSize]={0},sex[arrSize]={0},adress[arrSize]={0},phone[arrSize]={0};

intchoice=0;while(1){ret:printf("\n请选择1-7:");fflush(stdin);scanf("%d",&choice);fflush(stdin);switch(choice){case1:puts("请分别输入要添加的学生的信息");num=checkNumStrlen();printf("请输入要添加的学生姓名:");fflush(stdin);scanf("%s",name);

ret1://用于跳转语句1printf("请输入要添加的学生出生日期:");scanf("%s",birthday);if((birthday[4]!='-')||(birthday[7]!='-')){puts("您输入的出生日期格式有误,请按照:1990-09-20的格式输入!\n");gotoret1;}

ret2://用于跳转语句2while(1){printf("请输入要添加的学生性别:");scanf("%s",sex);if((strcmp(sex,"男")==0)||(strcmp(sex,"女")==0)){break;}else{puts("您输入的性别格式有误,请输入男或女!\n");gotoret2;}}printf("请输入要添加的学生家庭地址:");scanf("%s",adress);

ret3://用于跳转语句3while(1){printf("请输入要添加的学生联系方式:");scanf("%s",phone);if((strlen(phone)==11)||((strlen(phone)==12)&&(phone[4]=='-'))){break;}else{puts("您输入的联系方式格式有误,请按照:11位数字或者0710-9999999的格式输入!\n");gotoret3;}}system("cls");printf("系统正在添加学生信息,请稍候");wait();addStudent(num,name,birthday,sex,adress,phone);Sleep(100);puts("\n恭喜您!信息添加成功!\n");printList();puts("\n");menu();break;case2:printf("请输入要查找的学生学号:");scanf("%d",&num);system("cls");printf("系统正在查找学生信息,请稍候");wait();findStudentFromNum(num);printf("\n");printList();puts("\n");menu();break;

case3:printf("请输入要查找的学生姓名:");scanf("%s",name);system("cls");printf("系统正在查找学生信息,请稍候");wait();findStudentFromName(name);printf("\n");printList();puts("\n");menu();break;

case4:printf("请输入要修改的学生学号:");scanf("%d",&num);printf("请输入要修改的学生姓名:");scanf("%s",name);printf("请输入要修改的学生出生日期:");scanf("%s",birthday);printf("请输入要修改的学生性别:");scanf("%s",sex);printf("请输入要修改的学生家庭地址:");scanf("%s",adress);printf("请输入要修改的学生联系方式:");scanf("%s",phone);system("cls");printf("系统正在修改学生信息,请稍候");wait();modifyStudentFromNum(num,name,birthday,sex,adress,phone);Sleep(100);puts("\n恭喜您!信息修改成功!\n");printList();puts("\n");menu();break;

case5:printf("请输入要删除的学生学号:");scanf("%d",&num);puts("\n");system("cls");printf("系统正在删除学生信息,请稍候");wait();deleteStudentFromNum(num);Sleep(100);puts("\n恭喜您!信息删除成功!\n");printList();puts("\n");menu();break;case6:printf("请输入要删除的学生姓名:");scanf("%s",name);system("cls");printf("系统正在删除学生信息,请稍候");wait();deleteStudentFromName(name);Sleep(100);puts("\n恭喜您!信息删除成功!\n");printList();puts("\n");menu();break;case7:fp=fopen("student.txt","wt");if(fp==NULL){perror("fopen");return-1;}tmp_head=head->next;while(tmp_head){fwrite(tmp_head,sizeof(structstudent),1,fp);tmp_head=tmp_head->next;}fclose(fp);

exitPrograms();break;

default:puts("您输入的操作编号不在本系统服务区范围,请输入数字1-7!");gotoret;break;}}

THE END
1.C语言学生管理系统源代码学生管理系统c语言代码C语言-学生管理系统源代码 一、学生管理系统算法分析(增删改查) 1.插入学生信息(需要具备数据结构基础) 建立头结点、建立新结点函数、建立新结点并插入数据 voidInsertStudent(){//插入函数 intx; structStudentS; printf("请输入学生的数目:"); scanf("%d", &x);https://blog.csdn.net/weixin_51775646/article/details/121221130
2.C语言实现学生管理系统的源码分享C语言这篇文章主要为大家详细介绍了如何利用C语言实现学生管理系统,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下GPT4.0+Midjourney绘画+国内大模型 会员永久免费使用!【 如果你想靠AI翻身,你先需要一个靠谱的工具!】 注意:没有用到数据库使用链表完成此系统! 多文件实现 正式开始 代码https://www.jb51.net/article/257041.htm
3.C语言之学生管理系统代码(完整)「建议收藏」大家好,又见面了,我是你们的朋友全栈君。 代码语言:javascript 复制 #include<stdio.h>#include<stdlib.h>#defineFILENAME"student.dat"typedefenum{MAN,WOMAN}SEX;typedef struct tagStudent{int num;//学生的编号char name[20];//学生的姓名SEXsex;//学生的性别int age;//学生的年龄char major[20];//学生https://cloud.tencent.com/developer/article/2109860
4.C语言学生信息管理系统详细设计授权协议: 允许对本文提供的任何信息、资料进行使用、学习、修改等,但请注明引用出处。(白tom: qq1005252070) 1. 问题定义 1.1. 概述 不论是在校计算机专业的学生还是刚步入IT行业从事C工作的毕业生,对于C语言的基础考核,学生管理系统则作为不二的选择。该项目不论从难易程度还是知识考核点都易于被接受。 https://www.jianshu.com/p/daa347b860ca
5.C语言学生管理系统(结构体+数组实现)C语言-学生管理系统(结构体+数组实现) 描述 1. 学生管理系统功能介绍 前面文章里介绍了结构体类型,知道结构体类型里可以存放不同的数据类型,属于一个有序的集合。 这篇文章就使用结构体知识点完成一个小练习,使用结构体+数组设计一个简单的学生管理系统,作为结构体知识点的巩固练习。https://m.elecfans.com/article/1877266.html
6.计算机信息管理(停考)此前已通过原设置的3门分类加考课程中任意两门(含)以上课程的,可不参加新设置的分类加考课程的考试;已通过原设置的“计算机原理”(课程代码:2384,4学分)或“管理信息系统”(课程代码:2382、2383,5学分)一门课程的,可分别对应顶替新设置的一门与所通过课程完全相同的分类加考课程;已通过原设置的“高级语言程序https://cce.fudan.edu.cn/2c/f7/c14112a142583/page.htm
7.2022年高等职业教育质量年度报告通知公告2.7.3信息技术应用41 2.7.4教材改革42 3.政策保障42 43 https://www.hnkjxy.net.cn/html/809/2022-01-07/content-8186.html
8.?物联网应用技术专业2023级人才培养方案掌握信息产业链中大数据、计算机网络技术、软件技术、人工智能、数字媒体专业中的两种扩展技能所需的基础知识和基本技能;具备物联网应用技术专业职业岗位(群)所需的专业基本能力和专业技术应用能力,能够从事物联网系统设备安装与调试、物联网工程项目的规划、测试、维护、管理和服务、物联网系统运行管理和维护、物联网https://www.cswu.cn/dsjyxxcy/2023/0619/c3737a71175/page.htm
9.院校信息黑龙江科技大学招收攻读硕士学位研究生,是培养拥护中国共产党领导,拥护社会主义制度,爱国守法,为社会主义建设服务,掌握本学科坚实的基础理论和系统的专门知识,具有创新精神、创新能力、科研能力、实践能力和创业能力以及具有良好职业素养的高层次应用研究型专门人才。 https://yz.chsi.com.cn/wap/sch/detail?schId=368092&categoryId=10461149&infoId=1252774781