case 1: {
fp=fopen(\图书信息数据库.txt\
if(fp==NULL){printf(\数据库打开错误!请检查...\\n\ while(!feof(fp)) {
fscanf(fp,\press,&n[i].year,&n[i].claim_number,&n[i].unit_price,&n[i].collection,&n[i].can_borrow,&n[i].student_name,&n[i].sex,&n[i].student_id,&n[i].number); if(strcmp(title,n[i].title)==0) {
strcpy(d,n[i].press);strcpy(n[i].press,n[i].title);strcpy(n[i].title,d); e=n[i].number/10000;n[i].collection=e; f=n[i].number000;n[i].can_borrow=f; } i+=1; } j=i;
fclose(fp);
fp=fopen(\图书信息数据库.txt\
if(fp==NULL){printf(\数据库打开错误!请检查...\\n\ i=0;
while(j!=0) {
fprintf(fp,\ess,n[i].year,n[i].claim_number,n[i].unit_price,n[i].collection,n[i].can_borrow,n[i].student_name,n[i].sex,n[i].student_id,n[i].number); fflush(fp); i+=1; j-=1; } fclose(fp); system(\
printf(\删除成功!\\n\\n\ printf(\
-------------------------------------------------------\\n\
printf(\继续删除 [2].返回管理员功能菜单 [0].退出系统 \\n\
printf(\
-------------------------------------------------------\\n\ printf(\请选择:\ scanf(\ while(1)
{
switch(b) {
case 1:goto A;break; case 2:return(back=1); case 0: {
system(\ printf(\
------------------------------------------------------------\\n\
printf(\感谢使用,再见!\\n\
printf(\
------------------------------------------------------------\\n\ exit(0); } } } }
case 2:return(back=1); } } }
if(a!=1) {
fclose(fp);
printf(\未找到与书名相符的图书!\\n\\n\
printf(\ printf(\重新搜索 [2].返回管理员功能菜单 [0].退出系统 \\n\ printf(\ printf(\请选择:\ scanf(\ while(1) {
switch(b) {
case 1:goto A;break; case 2:return(back=1); case 0: {
system(\ printf(\
------------------------------------------------------------\\n\
printf(\感谢使用,再见! =- \\n\
=- printf(\
------------------------------------------------------------\\n\ exit(0); } } } } }
int borrow(int back)//【办理借书手续函数】 {
FILE *fp;
char title[100];
char student_name[50],sex[5],student_id[20]; struct Book *p,n[1000]; int a,b,c,d,i,j;
A:system(\为一个标志位,用于返回本函数首界面 back=0;a=0;b=0;i=0;j=0;d=0; printf(\请输入书名:\ scanf(\
fp=fopen(\图书信息数据库.txt\
if(fp==NULL){printf(\数据库打开错误!请检查...\\n\ p=(struct Book*)malloc(LONG); while(!feof(fp)) {
fscanf(fp,\year,p->claim_number,p->unit_price,&p->collection,&p->can_borrow,p->student_name,p->sex,p->student_id,&p->number);
if(strcmp(title,p->title)==0) {
a=1;
if(p->can_borrow!=0)b=1;
printf(\====\\n\
printf(\书名 作者 出版社 年份 索取号 馆藏 可借\\n\
printf(\----\\n\
printf(\im_number,p->collection,p->can_borrow); break; } } if(a!=1)
{
fclose(fp);
printf(\无该书信息!\\n\\n\
printf(\ printf(\继续搜索 [2].返回学生功能菜单 [0].退出系统 \\n\ printf(\ printf(\请选择:\ scanf(\ while(1) {
switch(c) {
case 1:goto A;
case 2:return(back=1); case 0: {
system(\ printf(\
------------------------------------------------------------\\n\
printf(\感谢使用,再见! =- \\n\
printf(\
------------------------------------------------------------\\n\ exit(0); } } } }
if(b!=1) {
fclose(fp);
printf(\无法办理该书借阅手续!\\n\\n\
printf(\ printf(\继续搜索 [2].返回学生功能菜单 [0].退出系统 \\n\ printf(\ printf(\请选择:\ scanf(\ while(1) {
switch(c) {
case 1:goto A;
case 2:return(back=1); case 0: {
system(\ printf(\
------------------------------------------------------------\\n\
printf(\感谢使用,再见! =- \\n\
printf(\
------------------------------------------------------------\\n\ exit(0); } } } }
if(b==1) {
printf(\是否办理该书借书手续?\\n\
printf(\ printf(\是 [2].否 \\n\ printf(\ scanf(\ while(1) {
switch(c) {
case 1: {
system(\
printf(\请输入你的个人信息:\\n\ printf(\
=======================================================\\n\
printf(\姓名 性别 学号 \\n\
printf(\
-------------------------------------------------------\\n\
scanf(\ fp=fopen(\图书信息数据库.txt\
if(fp==NULL){printf(\数据库打开错误!请检查...\\n\ while(!feof(fp)) {
fscanf(fp,\press,&n[i].year,&n[i].claim_number,&n[i].unit_price,&n[i].collection,&n[i].can_borrow,&n[i].student_name,&n[i].sex,&n[i].student_id,&n[i].number); if(strcmp(title,n[i].title)==0) {
if(d!=1&&strcmp(n[i].student_name,\未知\