PKU2503_map应用
Description
Input
Output
Sample Input
dog ogday
cat atcay
pig igpay
froot ootfray
loops oopslay atcay
ittenkay
oopslay
Sample Output
cat
eh
loops
Hint
#include<map>
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
int main()
{
map<string,string> m;
string s;
while(getline(cin,s)){
if(s.empty()) break;
int p,sz=s.size();
p=s.find(' ');
string a=s.substr(,p);
string b=s.substr(p+,sz-p-);
m[b]=a;
}
string t;
while(cin>>t){
if(!m[t].empty())
cout<<m[t]<<endl;
else cout<<"eh"<<endl;
}
}
PKU2503_map应用的更多相关文章
随机推荐
- 腾讯微博API时间线相关接口返回的微博信息中head值使用问题
腾讯微博API时间线相关接口返回的微博信息中head值表示作者头像url,这个链接直接访问并不能使用,需要再附加一个参数指定图片的大小(100.50),比如:[head]/100.
- 一个lucene源码分析的博客
ITpub上的一个lucene源码分析的博客,写的比较全面:http://blog.itpub.net/28624388/cid-93356-list-1/
- 从底层源码浅析Mybatis的SqlSessionFactory初始化过程
目录 搭建源码环境 POM依赖 测试SQL Mybatis全局配置文件 UserMapper接口 UserMapper配置 User实体 Main方法 快速进入Debug跟踪 源码分析准备 源码分析 ...
- PowerDesigner 把Comment/name 互转
转载:https://www.cnblogs.com/cxd4321/archive/2009/03/07/1405475.html 在使用PowerDesigner对数据库进行概念模型和物理模型设计 ...
- POJ-1887 Testing the CATCHER(dp,最长下降子序列)
Testing the CATCHER Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16515 Accepted: 6082 ...
- poj1001 Exponentiation【java大数】
Exponentiation Time Limit: 500MS Memory Limit: 10000K Total Submissions: 183034 Accepted: 44062 ...
- poj3417Network【LCA】【树形DP】
Yixght is a manager of the company called SzqNetwork(SN). Now she's very worried because she has jus ...
- split和strip的使用
我觉得都可以进行分隔,但最大的不同就是一个返回list,一个返回字符串 s1 = 'deng ye xun' s1.split() Out[8]: ['deng', 'ye', 'xun'] s1.s ...
- Oracle管理监控之rlwrap-0.37.tar.gz实现sqlplus上下翻页
1.上传rlwrap-0.37.tar.gz到linux 2.解压rlwrap-0.37.tar.gz [root@node1 mnt]# tar zxvf rlwrap-0.37.tar.gz [r ...
- Rikka with Sequence---hdu5828(区间更新与查找 线段树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5828 给你n个数,m个操作,操作k,l,r, k=1时 区间[l,r]每个数加x: k=2时,区间[l ...