POJ2503词典 Babelfish在外文中查找对应的英文
来源:互联网 发布:vb.net加载dll 编辑:程序博客网 时间:2024/05/01 07:47
A - Babelfish(6.1.2)(6.1使用词典解题实验范例)
Crawling in process...Crawling failedTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit
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
#include <iostream>#include<cstdio>#include<string.h>#include<map>using namespace std;int main(){ map<string,string>d; char a[11],b[11],c[24];//b在d的作用下变成a,s在d的作用下变成out,类似于加密 while(gets(c)) { if(strlen(c)==0) break; sscanf(c,"%s %s",a,b); d[b]=a; } string s,out; while(cin>>s) { out=d[s]; if(out.length()==0) cout<<"eh"<<endl; else cout<<out<<endl; } return 0;}//题意为b密文的原型为a,求s密文的原型
0 0
- POJ2503词典 Babelfish在外文中查找对应的英文
- poj2503-Babelfish(快速排序+二分查找)
- POJ2503 Babelfish
- Babelfish poj2503
- POJ2503 Babelfish
- poj2503 Babelfish
- POJ2503-Babelfish
- POJ2503--Babelfish
- POJ2503 Babelfish
- poj2503 Babelfish
- POJ2503-Babelfish
- [POJ2503] Babelfish
- POJ2503 Babelfish(Map键值对的应用)
- Babelfish Poj2503(STL map的使用)
- poj2503——Babelfish
- POJ2503 Babelfish Trie树
- POJ2503 Babelfish(hash)
- 北大ACM poj2503 Babelfish
- Oracle的常见问题
- 图片整理
- change Java on Ubuntu Kylin 15.04
- 黑马程序员—— Java 基础 面向对象之继承 (复习)
- 堆排序2.0
- POJ2503词典 Babelfish在外文中查找对应的英文
- 子父类中构造函数的特点
- zoj-2112(主席树动态求区间第k小数)
- UVA 11354 Bond(最小生成树+lca+倍增求祖先节点)
- 页面更新的问题
- 一次被黑追凶(未完待续)
- hdoj 1143 Tri Tiling 【递推】
- 链接MapReduce作业http://user.qzone.qq.com/1178772762/blog/1440417746
- Windows内核编程基础篇之字符串的拷贝