Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1.   #include <iostream>
  2.   #include <map>
  3.   #include <string>
  4.  
  5.   using namespace std;
  6.  
  7.   map<string, string> m;
  8.  
  9.   int main() {
  10.     ios_base::sync_with_stdio(false);
  11.     cin.tie(0);
  12.     int n;
  13.     cin >> n;
  14.     for (int i = 0; i < n; i++) {
  15.       string a, temp, b;
  16.       cin >> a >> temp >> b;
  17.       m[a] = b;
  18.     }
  19.     int T;
  20.     cin >> T;
  21.     while (T--) {
  22.       int k;
  23.       cin >> k;
  24.       for (int i = 0; i < k; i++) {
  25.         string a;
  26.         cin >> a;
  27.         cout << m[a] << ' ';
  28.       }
  29.       cout << '\n';
  30.     }
  31.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement