Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include<string>
  2. #include<iostream>
  3. #include<map>
  4. #include<cctype>
  5. #include<cstdio>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. int n;
  11. scanf("%d\n", &n);
  12.  
  13. char word[31], def[1025];
  14.  
  15. map<string, string>dex;
  16.  
  17. for(int i = 0; i < n; i ++) {
  18. scanf("%[^,],%[^\n]\n", word, def);
  19. dex[word]=def;
  20. }
  21.  
  22. while(EOF!=scanf("%s", word)) {
  23.  
  24. if(dex.find(word)!=dex.end()) {
  25.  
  26. printf("%s: %s\n", word, dex[word].c_str());
  27.  
  28. }else{
  29. printf("%s: -\n", word);
  30. }
  31. }
  32.  
  33. return 0;
  34.  
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement