Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <sstream>
  3. #include <map>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. ios::sync_with_stdio(false);
  10. map<string,string> lexicon;
  11. char key[10],value[10];
  12. bool trans = false;
  13. while(true){
  14. cin.get();
  15. char end = cin.peek();
  16. if (end == '\n'){
  17. if(trans) return 0;
  18. trans = true;
  19. if(!trans){
  20. scanf("%10s %10s",value,key);
  21. lexicon[key] = value;
  22. }else{
  23. scanf("%10s",key);
  24. if(lexicon[key].empty()) cout << "eh" << endl;
  25. else cout << lexicon[key] << endl;
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement