main() { // locates and prints all odd squares in the range 0 to n*n bag oddsquares; for(int i=0; i <= n; i++) oddsquares.insert(i*i); // insert all squares up to n squared for(int i=0; i <= n*n/2; i++) oddsquares.remove(2*i); // delete all even numbers for(int i=0; i <= n*n; i++) if (oddsquares.find(i)) cout << i << " is an odd square." << endl; // print the rest }