renewb.cpp

来自「图书馆管理系统 包括界面、书籍管理、会员管理等内容」· C++ 代码 · 共 57 行

CPP
57
字号
#include"liba.h"
void renewb()
{
   struct transaction T;
   int id,i,j,k,n;
   FILE *ft;

   window(1,1,80,2);
   textbackground(LIGHTGRAY);
   clrscr();
   textcolor(YELLOW);
   gotoxy(20,1);
   cprintf("Renew A Book");
   window(1,2,80,25);
   textbackground(BLUE);
   textcolor(WHITE);

   printf("\tPlease input your ID::");
   scanf("%d",&id);
   n=memcheck(id);
   if(n==FALSE)
   {
      printf("\nNo such a member exist!\tPress any key to return.");
      getch();
      return;
   }
   gotoxy(5,4); cprintf("Enter Book id::");
   gotoxy(9,5); cprintf("/");gotoxy(13,5); cprintf("/");
   gotoxy(5,5); scanf("%d",&i);
   gotoxy(10,5); scanf("%d",&j);
   gotoxy(14,5);scanf("%d",&k);
   n=chkbook(i,j,k);
  if(n==FALSE)
   {
     printf("\nNo such a book exist!\tPress any key to return.");
     getch();
     return;
   }

  ft=fopen("E:\\cpp\\trans.dat","r");
  rewind(ft);
  while(fread(&T,sizeof(T),1,ft)==1)
  {
    if(id==T.mid&&i==T.b.gno&&j==T.b.bno&&k==T.b.no)
    {
       transac2(id,i,j,k,'U');
       n=0;
    }
  }
  if(n==0)
  {
     printf("\nYou haven't borrowed such book!\nPress any key to return.");
     getch();
     return;
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?