Babelfish(map容器)
来源:互联网 发布:软件杯报名时间 编辑:程序博客网 时间:2024/05/23 11:49
Babelfish
Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 35621 Accepted: 15233
Description
You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.
Input
Input consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. Each dictionary entry is a line containing an English word, followed by a space and a foreign language word. No foreign word appears more than once in the dictionary. The message is a sequence of words in the foreign language, one word on each line. Each word in the input is a sequence of at most 10 lowercase letters.
Output
Output is the message translated to English, one word per line. Foreign words not in the dictionary should be translated as "eh".
Sample Input
dog ogdaycat atcaypig igpayfroot ootfrayloops oopslayatcayittenkayoopslay
Sample Output
catehloops
Hint
Huge input and output,scanf and printf are recommended.
#include<cstdio>#include<iostream>#include<cstring>#include<sstream>#include<map>using namespace std;int main(){ string a,b,f; char e[40]; map<string,string>mp; while(gets(e)) { f=e; if(f=="") { break; } else { stringstream ss(f); ss>>a; ss>>b; mp[b]=a; } } while(cin>>a) { if(mp[a]=="") { printf("eh\n"); } else { cout<<mp[a]<<endl; } }}
0 0
- Babelfish(map容器)
- POJ2503 Babelfish (map)
- 2503 Babelfish 二分 字典树 map容器
- POJ 2503 Babelfish STL-map容器
- UVA Babelfish(STL map)
- POJ 2503 Babelfish(map)
- poj Babelfish(二分||map)
- poj2503 Babelfish(map,二分)
- vua 10282 - Babelfish(Hash、map)
- poj 2503 Babelfish (map,trie 树)
- UVA - 10282 Babelfish(map应用)
- poj 2503 Babelfish(STL map写法)
- Babelfish(字典树-map映射功能)
- poj2503——Babelfish(STL,map)
- POJ-2503 Babelfish(map模板题)
- POJ 2503 Babelfish(人造字典map)
- POJ 2503 Babelfish(hash + map)
- POJ 2503-Babelfish(STL-map)
- 创建UIView对象的两种方法
- Web文件下载等待效果的实现
- qt android录音程序添加 Android 权限
- java中冒号(:)的用法
- Android Studio 快捷键
- Babelfish(map容器)
- Xamarin在VS2012没有智能提示的解决办法
- 重定向到另一个终端
- OC (IOS) 字符串 字符 NSData相互转换(NSStrng char NSData)
- ECSHOP将分类下的商品列表修改为当前的分类名称
- 关于安卓截取缩略图的方法和遇到的问题
- lua传"值"和传"引用"
- ubuntu首次给root用户设置密码
- makefile 模板