// Listing 3: Rund und die Standard Library

std::vector <int> myInt(10);
std::cout  << "vector of 10 times 0: ";
for (auto itr = myInt.begin(); itr != myInt.end(); ++itr){
  std::cout << *itr << " ";
}
std::cout << "\n\n";

// for (auto itr : myInt) { std::cout <<  *itr << " ";}
// for (std::vector<int>::const_iterator itr= intInt.begin(); itr != myInt.end(); ++itr){ ... }

std::iota(myInt.begin(), myInt.end(),1);
std::cout << "Increment each value by 1: ";
for (auto itr = myInt.begin(); itr != myInt.end(); ++itr){
  std::cout << *itr << " ";
}
std::cout << "\n\n";

std::sort(myInt.begin(),myInt.end(),[](int a, int b){ return a > b;} );
std::cout <<  "Sort the vector of natural numbers: ";
for (auto itr = myInt.begin(); itr != myInt.end(); ++itr){
  std::cout << *itr << " ";
}
std::cout  << "\n\n";

std::cout<< "std::min({1,2,4,0,1,-5,2}): " << std::min({1,2,4,0,1,-5,2}) << "\n\n";

std::map<std::string,std::string> phonebook =
  {{"Bjarne","+1 (012) 555-1212"},
   {"Herb", "+1 (345) 555-3434"},
   {"Alexandrei","+1 (678) 555-5656"}};
std::cout << "Get each telephone number:  \n";
for (auto itr = phonebook.begin(); itr!= phonebook.end(); ++itr){
  std::cout << itr->first << ": " << itr->second << "\n;
}