Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include < iostream >
- # include < map >
- #include < utility >
- int main()
- {
- std::map < std::string, int > m;
- std::map < std::string, int > ::const_iterator i;
- m[0] = 0;
- m[1] = 1;
- m[4] = 4;
- m[5] = 5;
- i = m.lower_bound(2);
- if (i != m.end())
- {
- std::cout << i->second << std::endl; // 4
- }
- i = m.lower_bound(1);
- if (i != m.end())
- {
- std::cout << i->second << std::endl; // 1
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement