⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 book.cpp

📁 大一时写的一个课设
💻 CPP
字号:
//定义书籍类的函数成员
# include <iostream.h>
# include <string.h>
# include <iomanip.h>
# include "book.h"
//添加书籍
void book::addbook(int n,char *na,int m)
{
	no=n;
	strcpy(name,na);
	onshelf=m;
	tag=1;
}
//是否在架
int book::shelf()
{
	if(onshelf>0)
	{
		cout<<"该书可借"<<endl;
		return 1;
	}
	else 
	return 0;
}
//借取书籍
void book::borrowbook(int a)
{
	if(a>0)
	onshelf--;
}
//归还书籍
void book::retbook(int a)
{
	if(a>0)
	onshelf++;
}
//显示信息
void book::showinfo()
{
	cout<<"书籍号码:"<<setw(10)<<no<<endl;
	cout<<"书籍名称:"<<setw(10)<<name<<endl;
	cout<<"在库数目:"<<setw(10)<<onshelf<<endl;
}

⌨️ 快捷键说明

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