记录编号 | 179902 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 查字典 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 2.329 s | ||
提交时间 | 2015-08-17 15:40:41 | 内存使用 | 0.39 MiB | ||
#include <fstream> #include <string> #include <algorithm> #define MAX 10001 using namespace std; ifstream fin("scanword.in"); ofstream fout("scanword.out"); class node { public: int page; string word; }x[MAX]; int main() { ios::sync_with_stdio(false); string scanw,scanws; int n,m; int k; fin>>n; for(int i=1;i<=n;i++) { fin>>scanw>>k; x[i].word=scanw; x[i].page=k; } fin>>m; for(int i=1;i<=m;i++) { fin>>scanws; for(int j=1;j<=n;j++) { if(scanws==x[j].word) { fout<<x[j].page<<endl; break; } else continue; } } return 0; }