帮同学写的C++大作业,图书管理系统

#include<iostream>
#include<cstring>
#include<cstdio>
#include<string>
#include<fstream>
#include<vector>
#include<map>
#include<cstdlib>
#include<queue>
#include<time.h>
#define debug
using namespace std;
string choice="2";
time_t timep;
struct tm *p;
bool logined=0; 
const int maxn=100;

class position
{
	public:
	int room;
	int shelf;
	int layer;
	position()
	{
		room=shelf=layer=0;
	}
	void setPos(int r,int s,int l)
	{
		room=r;shelf=s;layer=l;
	}
	void showPos()
	{
		cout<<"这本书在第 "<<this->room<<" 房间,第 "<<this->shelf<<" 排书架,第 "<<this->layer<<" 层。"<<endl; 
	}
};
class data
{
	public:
	int year,month,day;
	data()
	{
		year=month=day;
	}
	void setData(int y,int m,int d)
	{
		year=y;month=m;day=d;
	}
	void showData(int ifen)
	{
		cout<<year<<"年"<<month<<"月"<<day<<"日"; 
		if(ifen)
		cout<<endl;
	}
};
class book
{
	private:
	int number;
	data rent_data;
	data return_data;
	bool  rent[maxn];
	string book_ID;
	string book_name;
	position pos;
	public:
	void setBook(string Id,string name,int number,position bookPos)
	{
		book_ID=Id;
		book_name=name;
		this->number=number;
		pos=bookPos;
		memset(rent,0,sizeof(rent));
	}
	bool rentBook()
	{
		if(!logined)
		{
			cout<<"请登录\n";
			return 0;
		}
		if(number<=1)
		{
			cout<<"对不起,这本书已经被借完了\n";
			return 0;
		}
		p =localtime(&timep);
		rent_data.setDat
  • 2
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值