记录编号 265495 评测结果 AAAAAAAAAA
题目名称 查字典 最终得分 100
用户昵称 Gravatar背对疾风吧 是否通过 通过
代码语言 C++ 运行时间 1.899 s
提交时间 2016-06-02 20:40:37 内存使用 0.39 MiB
显示代码纯文本
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <string>
  6. using namespace std;
  7. struct word{
  8. string s;
  9. int page;
  10. }; struct word a[10010];
  11. int main()
  12. {
  13. freopen("scanword.in","r",stdin);
  14. freopen("scanword.out","w",stdout);
  15. int n,m,hehe[10010]={0},y=1;
  16. string s2;
  17. cin>>n;
  18. for(int i=1;i<=n;i++)
  19. {
  20. cin>>a[i].s>>a[i].page;// 实验谁最帅?背对疾风吧!
  21. }
  22. cin>>m;
  23. for(int i=1;i<=m;i++)
  24. {
  25. cin>>s2;
  26. for(int j=1;j<=n;j++)
  27. {
  28. if(a[j].s==s2)
  29. {hehe[y]=a[j].page;
  30. y++;
  31. break;}
  32. }
  33. }
  34. for(int i=1;i<=y-1;i++)
  35. cout<<hehe[i]<<endl;
  36. return 0;
  37. }