Advertisement
Rtyrewyger123

Untitled

Apr 27th, 2020
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. # include < iostream >
  2. # include < map >
  3. #include < utility >
  4. int main()
  5. {
  6. std::map < std::string, int > m;
  7. std::map < std::string, int > ::const_iterator i;
  8. m[0] = 0;
  9. m[1] = 1;
  10. m[4] = 4;
  11. m[5] = 5;
  12. i = m.lower_bound(2);
  13. if (i != m.end())
  14. {
  15. std::cout << i->second << std::endl; // 4
  16. }
  17. i = m.lower_bound(1);
  18. if (i != m.end())
  19. {
  20. std::cout << i->second << std::endl; // 1
  21. }
  22. system("pause");
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement