fork download
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6. map<int, string> mymap = {
  7. {1, "ala"},
  8. {4, "ma"},
  9. {8, "kota"}
  10. };
  11.  
  12. auto it = mymap.find(1);
  13. if (it != mymap.end())
  14. cout << "Znaleziona wartość: " << it->second << endl;
  15. else
  16. cout << "Wartosc nie znaleziona" << endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3416KB
stdin
Standard input is empty
stdout
Znaleziona wartość: ala