You have an extra ;in this line:
for(iter=myset.begin(); iter!=myset.end();++iter);{
This means that the loop body is actually empty, and the following lines are executed only once.
So, change this line to this:
for(iter=myset.begin(); iter!=myset.end();++iter) {
source
share