The + and | are union, & is intersection, - is difference, and ! will return all non-empty subsets as a list of sets in order by length, then contents ( Note that the contents part happens for free ). You can write a compare function and use it as an argument to list::sort().
The easiest way to generate subsets is to us a binary number and treat the positions as true/false in the set or not in the set. If there are 5 items, you want to look at everything between 00001 and 11111. The bitset is perfect for this ( You can assume that no input set will contain more that 64 elements. ).
You are going to read the sets as numbers on a line of input. So all of the numbers on the first line are the first set, and the second line is the second set. You need to verify that the input is actually numeric. This program will require input verification. You will want to use get, isdigit, and ungetc or putback to handle the input correctly.
the driver program
the header file
here is a sample run from mine
It is due on March 10th.