#include using namespace std; const int num=5; class people { public: people(int size=num); ~people(){delete[]p;} int&operator[](int off); const int&operator[](int off)const; int GetSize()const{return size;} class wrong{}; class offset { public: offset(int Size):size(Size){} ~offset(){} int Get(){return size;} private: int size; }; class Big:public offset { public: Big(int Size):offset(Size){} }; class Nav:public offset { public: Nav(int Size):offset(Size){} }; class Small { public: Small(int Size):size(Size){} ~Small(){} int get(){return size;} private: int size; }; class Zero:public Small { public: Zero(int Size):Small(Size){} }; private: int *p; int size; }; people::people(int Size):size(Size) { cout<<"调用构造函数\n"; if (Size==0) { throw Zero(Size); } if (Size<10) { throw Small(Size); } if (Size>10000) { throw Big(Size); } if (Size<1) { throw Nav(Size); } p=new int[size]; for (int i=0;i=0&&off=0&&off