Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<string>
- #include<iostream>
- #include<map>
- #include<cctype>
- #include<cstdio>
- using namespace std;
- int main() {
- int n;
- scanf("%d\n", &n);
- char word[31], def[1025];
- map<string, string>dex;
- for(int i = 0; i < n; i ++) {
- scanf("%[^,],%[^\n]\n", word, def);
- dex[word]=def;
- }
- while(EOF!=scanf("%s", word)) {
- if(dex.find(word)!=dex.end()) {
- printf("%s: %s\n", word, dex[word].c_str());
- }else{
- printf("%s: -\n", word);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement