dev/cpp/set_desort/set_desort.cpp

22 lines
442 B
C++

#include <set>
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
char *m[] = {"slkdjfs", "klsdjf", "lskdjfl", "lskdjf", "lskdjfl", "iogsfdneowrf", "oisdisjfwe", "qwldjsdj", "fsoiosjfs"};
set<string> s;
for (size_t i = 0, max_i = sizeof(m) / sizeof(char *); i < max_i; i++)
s.insert(m[i]);
for (set<string>::const_iterator it = s.begin(); it != s.end(); it++)
cout << it->c_str() << endl;
return 0;
}