c语言图书管理系统源代码(9)

2019-09-02 18:21

课程设计

{ color(12); printf(\◆你没有借任何书籍◆\\n\ color(9); } else { int i,n=0; char book_no[6]; BOOK *book_q; LIBRAY *libray_q; RETURN *return_pnew;

printf(\◆你已借阅的书籍有:\\n\NO *q,*q1;

libray_ifo_search(user_student->no,1); q1=no_phead->pnext;

printf(\序号 书号 书名 借书时间 归还时间\\n\ while(q1!=NULL) { libray_q=q1->libray_p; if(libray_q->judge==0) { book_q=book_no_search(libray_q->book_no); printf(\ %-5s %-30s\ printf(\

\ printf(\later_time.day); n++; } q1=q1->pnext; } q=NULL; while(no_phead->pnext!=NULL) { q=no_phead->pnext; no_phead->pnext=q->pnext; free(q); q=NULL; } free(no_phead); while(1)

第 41 页

课程设计

{

color(10);

printf(\●请输入需要还书的编号(4位必须写全,如0001):\scanf(\color(9);

if(strlen(book_no)==4) break; else { color(12);

printf(\◆你输入的编号不符合要求,请重新输入◆\\n\ color(9); } }

libray_q=libray_search(book_no); printf(\if(libray_q==NULL) { color(12); printf(\◆你没有借这本书,请查正编号后再输◆\\n\ color(9); } else { book_q=book_no_search(book_no);

printf(\◆要还的图书信息为:\\n\printf(\标签 书名 \\n\

printf(\ %s\\n\color(10);

printf(\◆是否要还此书?(是按1,放弃按0):\fflush(stdin); scanf(\color(9); if(i==1) { libray_q->judge=1; return_pnew=(RETURN *)malloc(sizeof(RETURN)); return_pnew->pnext=return_phead->pnext; return_phead->pnext=return_pnew; strcpy(return_pnew->book_no,book_q->no); strcpy(return_pnew->student_no,user_student->no); return_pnew->borrow_time.year=libray_q->borrow_time.year; return_pnew->borrow_time.month=libray_q->borrow_time.month; return_pnew->borrow_time.day=libray_q->borrow_time.day;

第 42 页

课程设计

return_pnew->time.year=year; return_pnew->time.month=month; return_pnew->time.day=day; book_q->number_now++; user_student->borrow--;

int m=sum_money(return_pnew); if(m==1) {

printf(\◆还书成功◆\\n\} else { color(12);

} } else

printf(\◆借书期限超限,需缴纳罚金,请到管理员处缴纳◆\\n\color(9);

printf(\◆还书成功◆\\n\

printf(\◆你已放弃还书◆\\n\ } } pause(2); }

//********************************************* //学生短消息模块

//********************************************* //231收消息

void user_message_receive() { cls(2);

printf(\?收件箱?\\n\\n\int i=0;

MESSAGE *message_p; STUDENT *student_p;

message_p=message_phead->pnext; while(message_p!=NULL) { if((strcmp(message_p->receive_no,user_student->no))==0) { student_p=student_search(message_p->send_no,2); printf(\序号:%d\\n\ printf(\发件人ID(学号):%s\\n\

第 43 页

课程设计

if(strcmp(message_p->send_no,admin_no)==0)

printf(\发件人姓名:管理员\\n\ else printf(\发件人姓名:%s\\n\ printf(\发送时间:%d/%d/%d\\n\_time.day); printf(\内容:%s\\n\ message_p->jude_read=1; i++; } message_p=message_p->pnext; } if(i==0) { color(12); printf(\◆你没有收到任何消息◆\\n\ color(9); } pause(2); }

//232发消息

void user_message_send() { cls(2); printf(\?发消息?\\n\\n\ int i;

MESSAGE * message_pnew;

message_pnew=(MESSAGE *)malloc(sizeof(MESSAGE)); while(1) { printf(\管理员ID为:11111111111\\n\ printf(\●输入对方ID(学号):\ fflush(stdin); gets(message_pnew->receive_no); if(check(message_pnew->receive_no,11,11)) break; }

while(1) { printf(\●内容(注:少于100个中文字包括符号,且不能有空格):\\n scanf(\ if(message_pnew->content,1,200)

break;

第 44 页

\ 课程设计

}

strcpy(message_pnew->send_no,user_student->no); message_pnew->send_time.year=year; message_pnew->send_time.month=month; message_pnew->send_time.day=day; message_pnew->jude_read=0; color(10);

printf(\◆是否发送?(是按1,否按0):\fflush(stdin); scanf(\color(9); if(i!=0) { message_pnew->pup=message_pend; message_pnew->pnext=NULL; message_pend->pnext=message_pnew; message_pend=message_pnew;

printf(\◆发送成功◆\\n\ } else { printf(\◆发送失败◆\\n\ free(message_pnew); } pause(2); }

//233删除消息

void user_message_delete() { cls(2);

printf(\?删除消息?\\n\\n\ int i=0,n=0; MESSAGE *message_p,*message_q,*q2; message_p=message_phead->pnext; while(message_p!=NULL) { if((strcmp(message_p->receive_no,user_student->no))==0) { printf(\●序号:%d\\n\ printf(\发件人学号:%s\\n\ printf(\发送时间:%d/%d/%d\\n\_time.day); printf(\内容:%s\\n\

第 45 页


c语言图书管理系统源代码(9).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2011高考最给力的作文素材

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: