记录编号 |
265495 |
评测结果 |
AAAAAAAAAA |
题目名称 |
查字典 |
最终得分 |
100 |
用户昵称 |
背对疾风吧 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
1.899 s |
提交时间 |
2016-06-02 20:40:37 |
内存使用 |
0.39 MiB |
显示代码纯文本
- #include <iostream>
- #include <cstdio>
- #include <algorithm>
- #include <cmath>
- #include <string>
- using namespace std;
- struct word{
- string s;
- int page;
- }; struct word a[10010];
- int main()
- {
- freopen("scanword.in","r",stdin);
- freopen("scanword.out","w",stdout);
- int n,m,hehe[10010]={0},y=1;
- string s2;
- cin>>n;
- for(int i=1;i<=n;i++)
- {
- cin>>a[i].s>>a[i].page;// 实验谁最帅?背对疾风吧!
- }
- cin>>m;
- for(int i=1;i<=m;i++)
- {
- cin>>s2;
- for(int j=1;j<=n;j++)
- {
- if(a[j].s==s2)
- {hehe[y]=a[j].page;
- y++;
- break;}
- }
- }
- for(int i=1;i<=y-1;i++)
- cout<<hehe[i]<<endl;
- return 0;
- }