您好,欢迎访问三七文档
#includestdio.h#includestdlib.h#includestring.htypedefstructinformation{charname[20];charsize[20];charnum[20];charnum1[20];chardate[20];charnum2[20];}INF;voidnum1();voidnum2();voidnum3();voidnum6();voidmenu1(){inta;system(cls);printf(\t\t\t请输入序号以选择你进入界面\n);printf(\t\t\t*****1.录入信息*****\n);printf(\n);printf(\n);printf(\t\t\t*****2.查询信息*****\n);printf(\n);printf(\n);printf(\t\t\t*****3.修改信息*****\n);printf(\n);printf(\n);printf(\t\t\t*****4.删除信息*****\n);printf(\n);printf(\n);scanf(%d,&a);if(a==1)num1();if(a==2)num2();if(a==3)num3();if(a==4)num6();}voidmean1();voidnum(){charA[7];inti,flag=0;R:system(cls);printf(\t******欢迎进入管理员登录系统******\n);printf(\n);printf(\n);printf(***********用户名:陈琳\n);printf(***********密码:);for(i=0;i=5;i++){A[i]=getch();printf(*);}A[6]='\0';getchar();getchar();if(strcmp(A,123456)==0){printf(\t\t密码正确正在登录系统....\n);printf(\t\t请输入回车键继续\n);getchar();menu1();}else{flag++;printf(你还有%d次机会\n,3-flag);printf(\t\t请输入回车键继续\n);getchar();if(flag3){gotoR;}}}voidmenu1();voidnum1(){intb;INFA[20];charch1;charch2;charch3;FILE*fp;intj;inti=0;L:printf(*******1.教材信息录入*******\n);printf(\n);printf(*******2.课程信息录入*******\n);scanf(%d,&b);if(b==1)M:{system(cls);fp=fopen(教材管理.txt,r+);while(!feof(fp)){fscanf(fp,%s%s%s%s%s%s,A[i].name,A[i].size,A[i].num,A[i].date,A[i].num1,A[i].num2);i++;}printf(******请录入教材编号******\n);scanf(%s,A[i].name);printf(******请录入教材名称******\n);scanf(%s,A[i].size);printf(******请录入出版社******\n);scanf(%s,A[i].num);printf(******请录入征刊号******\n);scanf(%s,A[i].date);printf(******请录入征订学期******\n);scanf(%s,A[i].num1);printf(******请录入课程编号******\n);scanf(%s,A[i].num2);fclose(fp);fp=fopen(教材管理.txt,w+);for(j=0;j=i;j++){fprintf(fp,%s\t%s\t%s\t%s\t%s\t%s\n,A[j].name,A[j].size,A[j].num,A[j].date,A[j].num1,A[j].num2);}system(cls);fclose(fp);printf(********你是否还想继续添加教材信息,请输入Y或N********\n);scanf(%s,&ch1);if(ch1=='Y'){gotoM;}else{printf(*******你是否想返回菜单请输入Y或N*******\n);scanf(%s,&ch2);if(ch2=='Y'){gotoL;}else{printf(********你是否想返回主菜单进行其他操作!请输入Y或N********\n);scanf(%s,&ch3);if(ch3=='Y')menu1();}}}elseG:{system(cls);fp=fopen(课程信息.txt,r+);while(!feof(fp)){fscanf(fp,%s%s%s%s,&A[i].name,&A[i].size,&A[i].num,&A[i].date);i++;}i--;printf(******请录入课程编号******\n);scanf(%s,&A[i].name);printf(******请录入课程名称******\n);scanf(%s,&A[i].size);printf(******请录入开学学期******\n);scanf(%s,&A[i].num);printf(******请录入主讲教师******\n);scanf(%s,&A[i].date);fclose(fp);fp=fopen(课程信息.txt,w+);for(j=0;j=i;j++){fprintf(fp,%s\t%s\t%s\t%s\n,A[j].name,A[j].size,A[j].num,A[j].date);}fclose(fp);system(cls);printf(********你是否还想继续添加课程信息,请输入Y或N********\n);scanf(%s,&ch1);if(ch1=='Y'){gotoG;}elseprintf(*******你是否想返回菜单*******);scanf(%s,&ch2);if(ch2=='Y'){gotoL;}else{printf(********你是否想返回主菜单进行其他操作!请输入Y或N********);scanf(%s,&ch3);if(ch3=='Y')menu1();}}}voidnum();voidmenu2();voidmenu3();voidnum2(){inta;charch1;system(cls);printf(\t\t\t******欢迎进入教材系统******\n);printf(\n);printf(\n);printf(\t\t\t*******1.教材管理*******\n);printf(\n);printf(\n);printf(\t\t\t*******2.课程信息*******\n);scanf(%d,&a);if(a==1){menu2();}elseif(a==2){menu3();}else{printf(\n);printf(\n);printf(\n);printf(要返回主菜单么?请输入Y或N\n);scanf(%s,&ch1);if(ch1=='Y'){num();}}}voidnum2();voidnum();voidnum7();voidnum8();voidnum9();voidmenu2(){inta;charch1;charch2;system(cls);printf(\t\t\t*******1.根据教材名查询*******\n);printf(\n);printf(\n);printf(\t\t\t*******2.根据编号查询*******\n);printf(\n);printf(\n);printf(\t\t\t*******3.总览全部********\n);printf(\n);printf(\n);printf(\t\t\t*******4.若想进入返回界面请输入任意数字\n);scanf(%d,&a);if(a==1){num7();}elseif(a==2){num8();}elseif(a==3){num9();}printf(\n);printf(\n);printf(\n);printf(要返回上一层么?请输入Y或N\n);scanf(%s,&ch1);if(ch1=='Y'){num2();}else{printf(要返回主菜单么?请输入Y或N\n);scanf(%s,&ch2);if(ch2=='Y'){num();}}}voidmenu2();voidnum7(){INFS;FILE*fp;charB[100];charch1;fp=fopen(教材管理.txt,r+);L:printf(\t\t请输入你要查询的教材名称:\n);printf(\t\t);scanf(%s,&B);printf(教材编号\t教材名称\t出版社\t\t刊号\t征订学期\t课程编号\n);while(!feof(fp)){fscanf(fp,%s%s%s%s%s%s,&S.name,&S.size,&S.num,&S.date,&S.num1,&S.num2);if(strcmp(B,S.size)==0){printf(%s\t%s\t%s\t%s\t%s\t%s\n,S.name,S.size,S.num,S.date,S.num1,S.num2);}}printf(你是否还要继续查询其他教材?请输入Y或N\n);scanf(%s,&ch1);if(ch1=='Y'){gotoL;}elseif(ch1=='N'){menu2();}}voidmenu2();voidnum8(){INFS;FILE*fp;charB[10];charch1;inti=1;fp=fopen(教材管理.txt,r+);L:printf(\t\t请输入你要查询的教材编号:\n);printf(\t\t);scanf(%s,&B);printf(教材编号\t教材名称\t出版社\t\t刊号\t征订学期\t课程编号\n);while(!feof(fp)){fscanf(fp,%s%s%s%s%s%s,&S.name,&S.size,&S.num,&S.date,&S.num1,&S.num2);if(strcmp(B,S.name)==0){printf(%s\t%s\t%s\t%s\t%s\t%s\n,S.name,S.size,S.num,S.date,S.num1,S.num2);}}printf(你是否还要继续查询其他教材?请输入Y或N\n);scanf(%s,&ch1);if(ch1=='Y'){gotoL;}elseif(ch1=='N'){menu2();}}voidnum();voidmenu2();voidnum9(){FILE*fp;INFS;charch1;charch2;fp=fopen(教材管理.txt,r+);printf(教材编号\t教材名称\t出版社\t\t刊号\t征订学期\t课程编号\n);while(!feof(fp)){fscanf(fp,%s%s%s%s%s%s,&S.name,S.size,S.num,S.date,S.num1,S.num2);printf(%s\t%s\t%s\t%s\t%s\t%s\n,S.name,S.size,S.num,S.date,S.num1,S.num2);printf(\n);printf(\n);}printf(\n);printf(\n);printf(********你是否要上一层?请输入Y或N********\n);scanf(%s,&ch1);system(cls);if(ch1='Y
本文标题:教材管理系统源程序
链接地址:https://www.777doc.com/doc-7356752 .html