prints all the keys and values in a map c++

#include <iostream>
#include <map>
using namespace std;

int main() {
    map<string, int> myMap;
    myMap["apple"] = 5;
    myMap["banana"] = 7;
    myMap["orange"] = 2;

    for (auto const &pair : myMap) {
        cout << "Key: " << pair.first << ", Value: " << pair.second << endl;
    }

    return 0;
}