set_desort
This commit is contained in:
parent
0ba66324e3
commit
56d38274e9
|
@ -0,0 +1,21 @@
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue