Poj2503 map映射使用
来源:互联网 发布:mysql删除数据恢复 编辑:程序博客网 时间:2024/05/16 11:27
Babelfish
Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 43624 Accepted: 18404
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普通的Key,Value取值;代码如下:#include<stdio.h>#include<iostream>#include<map>#include<string.h>#include<stdlib.h>using namespace std;int main(){map<string,string> mp;char str1[12],str2[12],str[30];while(gets(str)) { if(strlen(str)==0) break; sscanf(str,"%s %s",str1,str2); mp[str2]=str1; } string str3,p_out; while(cin>>str3) { p_out=mp[string(str3)]; if(p_out.length()==0) cout<<"eh"<<endl; else cout<<p_out<<endl; }return 0;}
0 0
- Poj2503 map映射使用
- POJ2503--Babelfish--map映射
- STL map的使用 POJ2503
- POJ2503-map
- poj2503 -Map
- Babelfish Poj2503(STL map的使用)
- POJ2503 Babelfish (输入格式控制与STL map的使用)
- poj2503 Babelfish(STL-map)
- POJ2503 Babelfish map做法
- POJ2503 Babelfish【map】
- POJ2503 Babelfish (map)
- map poj2503 Babelfish
- poj2503 map构建字典树
- poj2503(stl, map ,sscanf)
- poj2503 Babelfish(map,二分)
- poj2503查字典 -map或hash
- POJ2503
- poj2503
- 一:《方田》-- 5
- viewPager 设置指定页面是 不执行动画 (不闪屏)
- servlet中请求转发(forword)与重定向(sendredirect)的区别
- 软件测试方法-等价类、边界值、因果图
- 分布式计算开源框架Hadoop入门实践
- Poj2503 map映射使用
- 机器学习基石第三天学习笔记
- 查看网络连接数总结
- 解决mac电脑上出现Permission to xxx.git denied to xxx的问题
- formb表单上传图片
- Oracle数据库日期范围查询的两种实现方式
- 每日一练之Roman to integer & integer to Roman【LeetCode No.12,13】
- npm镜像安装和使用方法
- 解决ThinkPHP部署时Access denied.