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
page revision: 3, last edited: 20 May 2010 08:26