C学生学籍管理系统程序.docVIP

  • 11
  • 0
  • 约1.78万字
  • 约 20页
  • 2017-08-09 发布于湖北
  • 举报
C学生学籍管理系统程序

#includestdio.h ?? #includestring.h ?? #includestdlib.h ?? #includeconio.h ?? #define?N?100?/*存储100个学生的学籍信息*/ ?? int?flag;?/*标记是否登录*/?? struct?date?/*出生日期*/?? {?? ????int?year;?? ????int?month;?? ????int?day;?? };?? struct?student?? {?? ????char?num[20];/*学号*/?? ????char?name[25];/*姓名*/?? ????char?sex[10];/*性别*/?? ????struct?date?birthday;/*出生年月*/?? ????int?age;/*年龄*/?? ????char?addr[50];/*籍贯*/?? ????char?dept[50];?/*系别*/?? ????char?major[30];?/*专业*/?? ????char?classs[30];?/*班级*/?? ????char?phone[20];/*电话*/?? }stu[N];?? ?? void?login()?/*登录*/?? {?? ????void?menu();?? ????system(cls);?? ????if(flag)?? ????{?? ????????printf(??已经登录!\n);?? ????????printf(Press?any?key?to?continue…\n);?? ????????getchar();?? ????????getchar();?? ????????system(cls);?? ????????menu();?? ????}?? ????int?load();?? ????int?n,i,m,w;?? ????FILE?*fp;?? ????if((fp=fopen(D:\\file.txt,rb))!=NULL)?/*不是空文件*/?? ??????n=load();?/*打开文件*/?? ????else?? ??????n=0;?? ????struct?student?s;?? ????char?password[20];?? ????int?d,q;?? ????printf(\n\t请选择登录身份:1.管理员??????2.用户?????[?]\b\b);?? ????scanf(%d,d);?? ????if(d==1)?? ????{?? ????????printf(\n\t\t\t请输入密码:);?? ????????getchar();?? ????????int?j=0;?? ????????while(1)?? ????????{?? ????????????password[j]=getch();?? ????????????if(password[j]==\r)?? ??????????????break;?? ????????????printf(*);?? ????????????j++;?? ????????}?? ????????password[j]=\0;?? ????????if(!strcmp(password,930322))?/*判断密码是否正确*/?? ????????{?? ????????????flag=1;?? ????????????printf(\n\t登录成功!\n);?? ????????????printf(\tPress?[?Enter?]?key?to?continue…);?? ????????????getchar();?? ????????????system(cls);?? ????????????menu();?? ????????}?? ????????if(!flag)?? ????????{?? ???????????printf(\t\n密码错误!\n);?? ???????????printf(What?do?you?want?to?do?next??1.继续登录??2.返回菜单???[?]\b\b);?? ???????????scanf(%d,q);?? ???????????if(q==1)?/*继续登录*/?? ???????????{?? ???????????????system(cls);?? ???????????????login();?? ???????????}?? ???????????else?if(q==2)?/*返回主菜单*/?? ???????????{?? ???????????????s

文档评论(0)

1亿VIP精品文档

相关文档