- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpriority.cpp
More file actions
Latest commit
40 lines (32 loc) · 691 Bytes
/
Copy pathpriority.cpp
File metadata and controls
40 lines (32 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<stdio.h>
#include<map>
#include<list>
enum Priority
{
First,
Second,
Third,
};
voidmain()
{
typedef std::list< std::string > strList;
std::map< Priority, strList, std::less< Priority > > map;
strList secondList;
secondList.push_back("2");
map.insert(std::make_pair(Second, secondList));
strList thirdList;
thirdList.push_back("3");
map.insert(std::make_pair(Third, thirdList));
strList firstList;
firstList.push_back("1_1");
firstList.push_back("1_2");
map.insert(std::make_pair(First, firstList));
for (constauto &m : map)
{
for (constauto &s : m.second)
{
printf("%s\n", s.c_str());
}
}
getchar();
}