#include using namespace std; class Set { private: // implementation details: // ... int a; public: // public interface: Set(); // the default constructor // - initializes the set to empty set Set(long a, long b, long c=1); // initializes the set to the set // containing the elements a, a+c, a+2*c, a+3*c, ... // which are smaller or equal to b Set(long list[],long size); // initializes the set to elements // contained in the array list; the size should be size of the array // (note: you cannot assume that elements in list are all distinct) Set(const Set &s); // the copy constructor ~Set(); // destructor // if the following methods return a reference to Set, // it should be reference to itself (which allows chaining of the operations) Set & operator=(const Set &s); // the assignment operator operator long() const; // return the number of elements bool operator()(long x) const; // return true if x is an element of the set bool operator==(const Set &s) const; // return true if s contains the same elements bool operator<=(const Set &s) const; // return true if this object is subset of s bool operator>=(const Set &s) const; // return true if s is subset of this object Set & operator<<(long x); // add x to the set Set & operator>>(long x); // remove x from the set // (if x is not in the set, do nothing) Set operator+(const Set &s) const; // return the union with the set s Set & operator+=(const Set &s); // add all elements of the set s Set operator*(const Set &s) const; // return the intersection with the set s Set & operator*=(const Set &s); // keep only those elements which are also in s Set operator-(const Set &s) const; // return the set difference with the set s Set & operator-=(const Set &s); // remove those elements which are also in s friend ostream & operator<<(ostream &os, const Set &s); // print the content of the set s };