Answer:
C++.
Explanation:
<em>Code snippet.</em>
#include <map>
#include <iterator>
cin<<N;
cout<<endl;
/////////////////////////////////////////////////
map<string, string> contacts;
string name, number;
for (int i = 0; i < N; i++) {
cin<<name;
cin<<number;
cout<<endl;
contacts.insert(pair<string, string> (name, number));
}
/////////////////////////////////////////////////////////////////////
map<string, string>::iterator it = contacts.begin();
while (it != contacts.end()) {
name= it->first;
number = it->second;
cout<<word<<" : "<< count<<endl;
it++;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
I have used a C++ data structure or collection called Maps for the solution to the question.
Maps is part of STL in C++. It stores key value pairs as an element. And is perfect for the task at hand.