// Exercise description: // Write a program that takes in multiple command line arguments as strings, // uses an unordered_multimap to map from string length to strings, and prints // out the contents of the map, i.e. the key and value. // // Sample Solution: #include #include #include using namespace std; int main(int argc, char **argv) { unordered_multimap map; // Map each string's length to the string itself for (int i = 1; i < argc; i++) { int len = strlen(argv[i]); string word(argv[i]); map.insert(pair(len, word)); } // Print out the map keys and values for (auto& it: map) cout << it.first << ": " << it.second << endl; }