Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <map>
- using namespace std;
- int main()
- {
- ios::sync_with_stdio(false);
- map<string,string> lexicon;
- char key[10],value[10];
- bool trans = false;
- while(true){
- cin.get();
- char end = cin.peek();
- if (end == '\n'){
- if(trans) return 0;
- trans = true;
- if(!trans){
- scanf("%10s %10s",value,key);
- lexicon[key] = value;
- }else{
- scanf("%10s",key);
- if(lexicon[key].empty()) cout << "eh" << endl;
- else cout << lexicon[key] << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement