-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.cpp
44 lines (39 loc) · 964 Bytes
/
map.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file map.cpp
* @author Md. Alamin (alamin5g@yahoo.com)
* I would love be a software engineer at Google. That is why anybody can uses this code without any condition, if you face any difficulty, then try to email me.
* @version 0.1
* @date 2022-10-14
*
* @copyright Copyright (c) 2022
*
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main() {
map<string, string> phoneBook;
int n;
cin >> n;
string name, number;
for(auto i=0; i<n; i++){
cin >> name;
cin >> number;
phoneBook[name] = number;
}
map<string, string>::iterator it;
string search;
while(cin>>search){
it = phoneBook.find(search);
if(it != phoneBook.end()){
cout << it->first << "=" << it->second << endl;
}else{
cout << "Not found" <<endl;
}
}
return 0;
}