You are viewing a single comment's thread. Return to all comments →
USING UNORDERD MAPS:
using namespace std; int main(){ int n,i,num; cin>>n; string name;
unordered_map<string,int>pbook; while(n--) { cin>>name; cin>>num; pbook[name]=num; } string sname; while(cin>>sname){ if(pbook.find(sname)==pbook.end()) cout<<"Not found"<<endl; else cout<<sname<<'='<<pbook[sname]<<endl; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
USING UNORDERD MAPS:
include
using namespace std; int main(){ int n,i,num; cin>>n; string name;
}