#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
map<string, int> phoneBook;
int n = 0;
cin >> n;
for (int i = 0; i < n; i++) {
string name;
cin >> name;
int number;
cin >> number;
phoneBook.insert(pair<string, int> (name, number));
}
string query;
while(cin >> query) {
/*find returns Iterator to an element with key equivalent to `key`.
If no such element is found, past-the-end iterator is returned. */
auto search = phoneBook.find(query);
if ( search != phoneBook.end()) {
cout << search->first << "=" << search->second << endl;
} else {
cout << "Not found" << endl;
}
}
return 0;
}
网友评论