#include <string>
#include <iostream>
using namespace std;
/********* Begin *********/
class User
{
//在此处声明所需的成员
public:
string Name; int Books;
User(string name, int books);
~User();
static void GetState();
}; static int UserCount=0, BookCount=0;
//在此处定义成员函数
User:: User(string name, int books)
{
Name = name; Books = books;
cout << name << " " << books << " " << "进入" << endl; UserCount++; BookCount+=books;
}
User::~User()
{
cout << Name << " " << Books << " " << "离开" << endl; UserCount--; BookCount-=Books;
}
void User::GetState()
{
cout << "书店人数:" << UserCount << "," << "书店共享书数量:" << BookCount << "," << "人均共享数量:" << BookCount / UserCount << endl;
}
/********* End *********/