#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(&am
帮同学写的C++大作业,图书管理系统
最新推荐文章于 2025-06-29 16:09:48 发布