#include <iostream>
#include <string>
#include <map>
#include <set>
using namespace std;
void Find(map<string, set<int>>&list, string &x)
{
if (list.find(x) == list.end())
cout << "Not Found" << endl;
else
{
for (set<int>::iterator it = list[x].begin(); it != list[x].end(); it++)
{
printf("d\n", *it);
}
}
}
int main()
{
int n;
cin >> n;
map<string, set<int>>namel,authorl,keyl,publisherl,yearl;
while (n--)
{
int num;
cin >> num;
getchar();
string temp;
getline(cin, temp);
namel[temp].insert(num);
getline(cin, temp);
authorl[temp].insert(num);
while (cin >> temp)
{
keyl[temp].insert(num);
char c = getchar();
if (c == '\n')break;
}
getline(cin, temp);
publisherl[temp].insert(num);
getline(cin, temp);
yearl[temp].insert(num);
}
int m;
cin >> m;
while (m--)
{
int type;
cin >> type;
cout << type << ": ";
getchar(); getchar();
string temp;
getline(cin, temp);
cout << temp << endl;
switch (type)
{
case 1:
Find(namel, temp);
break;
case 2:
Find(authorl, temp);
break;
case 3:
Find(keyl, temp);
break;
case 4:
Find(publisherl, temp);
break;
case 5:
Find(yearl, temp);
break;
}
}
system("pause");
return 0;
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-17952.html