Stl Set

c++

#include <iostream>
#include <set>
#include <string>
#include <algorithm> /* for lulz! */
#include <assert.h>
using namespace std;
 
int main(void)
{
    string LOL [] = {"LOOOL", "LOL", "LULZ"};
    set <string> lolz;
    set <string>::iterator w00t;
    lolz.insert(LOL[0]);
    lolz.insert(LOL[1]);
    lolz.insert(LOL[2]);
    for (w00t = lolz.begin(); w00t != lolz.end(); w00t++)
    {
        cout << " .." << *w00t <<"\n";
    }
 
    return 0;
}

python

OMG_LOL = [ i for i in xrange(0, 100)]:
OMG_A_SET = set(OMG_LOL)
print OMG_A_SET
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License