Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 9th, 2020 178 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7.     std::map<std::string, std::string>
  8.         phonebook;
  9.  
  10.     phonebook.emplace(
  11.         std::pair<std::string, std::string>
  12.         {"Baabel", "08-5522134"}
  13.     );
  14.  
  15.     phonebook["Santa Maria"] = "08-344887";
  16.     phonebook["Turtles"] = "08-5555595";
  17.  
  18.     for (const auto& entry : phonebook)
  19.     {
  20.         std::cout << entry.first << " - "
  21.                   << entry.second << "\n";
  22.     }
  23.  
  24.     std::string input;
  25.  
  26.     std::cout << "Enter name\n";
  27.     while(std::getline(std::cin, input))
  28.     {
  29.         if (input.empty())
  30.             break;
  31.  
  32.         if (phonebook.count(input) != 0)
  33.             std::cout << phonebook[input] << "\n";
  34.         else
  35.             std::cout << "not in phonebook\n";
  36.     }
  37.     return 0;
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top