总共实现了myDate类,book类,student类,图书借阅记录record类
//
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <ctime>
#include <cstdio>
using namespace std;
//主要就基于C库封装了一个获取时间戳的数据成员和相关方法
class myDate
{
time_t _time;
public:
myDate()
{
time (&this->_time);
cout<<"get time sucessful"<<endl;
}
friend ostream& operator<<(ostream &out,myDate &d);
};
ostream& operator <<(ostream &out,myDate &d)
{
out<<ctime(&(d._time));
return out;
}
//book类主要封装一个图书信息(书名和数量)
class book
{
//string bookid;
string bookname;
int bookcount;
public:
explicit book(string bname,int bcount):
bookname(bname),bookcount(bcount)
{
}
int insertBook()
{
if(bookcount < 0)
return -1;
bookcount += 1;
return 0;
}
int removeBook()
{
if(bookcount <= 0)
return -1;
bookcount -= 1;
return 0;
}
string& getname()
{
return bookname;
}
void print()
{
cout<<"bname:"<<bookname<<",count:"<<bookcount<<endl;
}
};
//record类封装一条借阅记录<who,do,bookname>
class recordPer
{
bool f ;//true brrow -- false return