2016/12/8 1002.Babelfish
来源:互联网 发布:cocos2d js下载 编辑:程序博客网 时间:2024/05/17 23:58
用map很简单做出来,注意下输入时getline和cin就没什么问题了。
// Problem#: 19853// Submission#: 4951498// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic Lab of Sun Yat-sen University#include <iostream>#include <string>#include <map>using namespace std;int main(){ string a,b; map <string,string> maps; for(;;) { getline(cin,a); if(a=="")break; else { b=a.substr(a.find(" ")+1); a=a.substr(0,a.find(" ")); maps[b]=a; } } while(cin >> a) { if(maps.find(a)==maps.end()) { cout << "eh" << endl; } else cout << maps[a] << endl; }}
0 0
- 2016/12/8 1002.Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- Babelfish
- R - Babelfish
- 10282 - Babelfish(***)
- 【STL】Babelfish
- POJ2503 Babelfish
- Babelfish poj2503
- 10282 - Babelfish
- js闭包总结
- JAVA用swing做个日历
- 识别macho block的ida脚本
- nuoj 114 大数
- [编程题]取近似值
- 2016/12/8 1002.Babelfish
- DOS批处理前言
- mybatis多表关联查询
- Android 6.0下出错: UnsatisfiedLinkError: dlopen failed . text relocations
- hdu 5988 费用流
- 我在路上---贪懒
- CVPR 2016-12-01
- 2016/12/8 1003. 简单哈希
- 利用ajaxSubmit提交的时候,解决多个input name相同的问题