c語言 圖書管理系統 源代碼( 四 )


printf("\n");
printf("否繼續書[(y)/否(n)]\n");
do
{
x=getche();
}while(x!='n'&&x!='y');
if(x=='n')
break;
}
fclose(fp);
system("cls");
}
//瀏覽
voidscan_book()
{
FILE*fp;
charx,z;
structbookn;
fp=fopen("F:\\課程設計\\圖書管理系統.txt","rb");
rewind(fp);
system("cls");
while(1)
{
fread(&n,sizeof(n),1,fp);
if(feof(fp))
break;
else
{
printf("********************************************\n");
printf("編號書名作者版社版間價格狀態借閱者\n");
printf("\n");
printf("%s%s%s%s%s%s%s%s",n.number,n.tittle,n.writer,n.publisher,n.date,n.price,n.status,n.reader);
printf("\n");
}
}
printf("\n");
printf("主菜單請按車");
do
{
x=getche();
}while(x!='\r');
if(x=='\r')
{
fclose(fp);
system("cls");
}
}

猜你喜歡