




已阅读5页,还剩23页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#include #include #include #include #define select inttypedef struct /账户信息 char name20; /U char pw20; /User.pw User;typedef struct char Num20; char n120; char Class20; char time100; char reason100; char instructor100; Leave;typedef struct char n120; char Num20;/ char name20; char Class20; char time100; char reason100; char instructor100;char suggest100; TEACHER;int check (char name20) int i=0; User ru; FILE *f =fopen(data.dat,rb); rewind(f); for(i=0; !feof(f); i+) int d=i*sizeof(User); fseek(f,d,SEEK_SET); fread(&ru,sizeof(User),1,f); if(strcmp(name,)=0) return 1; return -1;int login(char name20,char pw20) User us; FILE *f =fopen(data.dat,rb); while(!feof(f) fread(&us,sizeof(User),1,f); if(strcmp(name,)=0) if(strcmp(pw,us.pw)=0)return 1; return -1;int main() char n20; char plog20; char nlog20; int c; User u; FILE *f =fopen(data.dat,ab); if(f!=NULL) fwrite(&u,sizeof(User),1,f); fclose(f);Login: system(color F0); system(cls); printf(nn); printf(=n); printf(| |n); printf(|-学生请假系统-|n); printf(| |n); printf(=n); printf(n); Sleep(1000); printf(n); printf(请输入帐号:); scanf(%s,nlog); c=check(nlog); if(c=1)/如果账户存在 strcpy(n,nlog);/复制登录帐号 if(strlen(n)=9)/如果是学生 int a,i; select s=0; printf(n); printf(请输入密码:);/直接输入密码 scanf(%s,plog); for(a=2,i=0; i0) printf(请重新输入密码(你还有%d次机会):,a); printf(nn); scanf(%s,plog); if(login(nlog,plog)=1) goto success2; else return 0; if(login(nlog,plog)=1) success2: system(color F0); printf(nn); printf( 登陆成功/n); Sleep(1000); system(cls); LEAVESYSTEM: printf(nn); printf(=n); printf(|1.提交请假申请 |n); printf(|2.查询请假批准状态 |n); printf(| 如无需操作,可直接关闭程序 |n); printf(=n); printf(nn); Sleep(1000); printf(请输入您要执行的选项:); scanf(%d,&s); Sleep(1000); while(s!=1&s!=2) if(s!=1&s!=2) system(color 0c); printf(选项不存在,请重新输入(1/2):); s=0; scanf(%d,&s); if(s=1)/写入请假 system(color F0); system(cls); printf(nn); printf(=n); printf(| |n); printf(|-提交请假申请-|n); printf(| |n); printf(=n); printf(nn); Leave a; Sleep(1000); printf(请输入班级:n); scanf(%s,a.Class); printf(请输入姓名:n); scanf(%s,a.n1); printf(请详细输入请假时间:n); scanf(%s,a.time); printf(请详细输入请假原因:n); scanf(%s,a.reason); strcpy(nlog,a.Num); strcpy(a.instructor,0); FILE *t=fopen(leave.dat,ab); fwrite(&a,sizeof(Leave),1,t);/讲以变量u的地址开始的内存区域的一个数据写到f指向的文件中,每个数据占sizeof(User) fclose(t); fflush(t);/ Sleep(1000); printf(n); printf( 保存成功/n); printf( 请不定时来查询你的假条申请状态!nnn); system(pause); system(cls); goto LEAVESYSTEM; if(s=2)/学生查询状态代码 system(color F0); system(cls); printf(nn); printf(=n); printf(| |n); printf(|-查询请假批准状态-|n); printf(| |n); printf(=n); Sleep(1000); TEACHER b; FILE *t=fopen(read.dat,rb); while(1) if(!(fread(&b,sizeof(TEACHER),1,t) break; if(strcmp(nlog,b.Num)=0) printf(-n); printf(|学生%s请假申请反馈信息: n,b.n1); printf(|班级:%sn n,b.Class); printf(|姓名:%sn n,b.n1); printf(|请假时间:%sn n,b.time); printf(|请假原因:%sn n,b.reason); printf(-n); Sleep(1000); printf(n); printf( -n); printf( 申请状态:%sn,b.instructor); printf( 辅导员意见:%sn,b.suggest); printf( -n); system(pause); Sleep(1000); system(cls); goto LEAVESYSTEM; if(s=3) goto Login; /身份学生 if(strlen(n)=4)/如果是辅导员 int a,i; select s; printf(n); printf(请输入密码:);/直接输入密码 scanf(%s,plog); for(a=2,i=0; i0) printf(请重新输入密码(你还有%d次机会):,a); printf(nn); scanf(%s,plog); if(login(nlog,plog)=1) goto success3; else return 0; if(login(nlog,plog)=1) success3: system(color F0); printf(nn); printf( 登陆成功/n); Sleep(1000); /Approvalsystem: system(cls); printf(nn); printf(=n); printf(| |n); printf(|-学生请假系统(辅导员端)-|n); printf(| |n); printf(=n); printf(n); Sleep(1000); printf(=n); printf(|1.查看学生请假申请 |n); printf(|2.返回登陆界面 |n); printf(| 如无需操作,可直接关闭程序 |n); printf(=n); printf(nn); Sleep(1000); printf(请输入您要执行的选项:); scanf(%d,&s); while(s!=1&s!=2) if(s!=1&s!=2) printf(选项不存在,请重新输入(1/2):); scanf(%d,&s); if(s=1)/辅导员读 system(cls); printf(nn); printf(=n); printf(| |n); printf(|-查看学生请假申请-|n); printf(| |n); printf(=n); printf(nn); Sleep(1000); Leave a; FILE *t=fopen(leave.dat,rb); while(1) int ch; if(!(fread(&a,sizeof(Leave),1,t) break; printf(-n); printf(|学生信息如下:n); printf(|班级:%sn,a.Class); printf(|姓名:%sn,a.n1); printf(|学号:%sn,a.Num); printf(|请假时间:%sn,a.time); printf(|请假原因:%sn,a.reason); printf(-n); Sleep(1000); printf(nnn); printf( n); printf( 是否批准学生请假申请 n); printf( - n); printf( - n); printf( 1.批准学生请假申请 n); printf( 2.不批准学生请假申请 n); printf(nnn); printf(请输入您要执行的选项:); scanf(%d,&ch); while(ch!=1&ch!=2) if(ch!=1&ch!=2) printf(选项不存在,请重新输入(1/2):); scanf(%d,&ch); if(ch=1) printf(nn); printf(-n); printf(执行中.n); printf(-n); Sleep(1000); TEACHER b; FILE *F=fopen(read.dat,ab); strcpy(b.instructor,您的请假申请已被批准!); printf(n); printf(辅导员意见:); scanf(%s,b.suggest); strcpy(b.Class,a.Class); strcpy(b.n1,a.n1); strcpy(b.time,a.time); strcpy(b.reason,a.reason); strcpy(b.Num,a.Num);/ FILE *f3=fopen(leave.dat,ab); fwrite(&b,sizeof(TEACHER),1,F); fclose(F); fflush(F); Sleep(1000); printf(nnn); printf( 操作成功/n); system(pause); printf(nnnnn); continue; if(ch=2) printf(-n); printf(执行中.n); printf(-n); Sleep(1000); TEACHER b; FILE *F=fopen(read.dat,ab); strcpy(b.instructor,您的请假申请没有被批准,请按时上课!); printf(n); printf(辅导员意见:); scanf(%s,b.suggest); strcpy(b.Class,a.Class); strcpy(b.n1,a.n1); strcpy(b.time,a.time); strcpy(b.reason,a.reason); strcpy(b.Num,a.Num); fwrite(&b,sizeof(TEACHER),1,F); fclose(F); fflush(F); Sleep(1000); printf(nnn); printf( 操作成功/n); system(pause); printf(nnnnn); continue; if(s=2) system(cls); goto Login; /修改学生请假申请状态 反回 /如果是辅导员 if(strlen(n)=5)/如果是老师 int a,i; printf(n); printf(请输入密码:);/直接输入密码 scanf(%s,plog); for(a=2,i=0; i0) printf(请重新输入密码(你还有%d次机会):,a); printf(nn); scanf(%s,plog); if(login(nlog,plog)=1) goto success1; else return 0; if(login(nlog,plog)=1) success1: system(color F0); printf(nn); print
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 核酸检测站管理制度
- 档案远程化管理制度
- 检测站规章管理制度
- 棉纺厂设备管理制度
- 模具部奖惩管理制度
- 母基金投资管理制度
- 比亚迪卫生管理制度
- 民宿服务站管理制度
- 家用纺织品的设计思路与选择
- 氮气暂存间管理制度
- 2024年凉山州木里县选聘社区工作者真题
- 九师联盟2024-2025学年高二下学期6月摸底联考英语试题(含答案)
- 2025年高考英语全国二卷(解析)
- 医院护理岗位笔试题目及答案
- 芯核半导体科技有限公司年产2400套半导体零部件项目环评资料环境影响
- 2025家常保姆雇佣合同协议书
- 妇科腔镜试题及答案
- 语文 《“蛟龙”探海》课件-2024-2025学年统编版语文七年级下册
- 中医基础理论2025年专业考试试题及答案
- 2025年智慧园区管理知识考试卷及答案
- 2025年企业管理者能力测评试卷及答案
评论
0/150
提交评论