Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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, i;
  11. scanf("%d\n", &n);
  12. char cuv[31], def[1025];
  13. map<string, string>dex;
  14. for(int i = 0; i < n; i ++) {
  15. scanf("%[^, ], %[^\n]\n", cuv, def);
  16. dex[cuv]=def;
  17. }
  18. while(EOF!=scanf("%s", cuv)) {
  19.  
  20. if(dex.find(cuv)!=dex.end()) {
  21.  
  22. printf("%s: %s\n", cuv, dex[cuv].c_str());
  23.  
  24. }else{
  25. printf("%s: -\n", cuv);
  26. }
  27. }
  28.  
  29. return 0;
  30.  
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement