HDU1075 What Are You Talking About
来源:互联网 发布:淘宝粉星便利店靠谱么 编辑:程序博客网 时间:2024/05/01 14:24
本题用到的是STL中的map 函数,,,借助了kuangbin大神的帮助。。。
代码如下,,,自己看吧。
/*HDU 1075*/#include<stdio.h>#include<algorithm>#include<iostream>#include<string>#include<map>#include<string.h>using namespace std;map<string,string>mp;int main(){ mp.clear(); string str1,str2; cin>>str1; while(cin>>str1) { if(str1=="END")break; cin>>str2; mp[str2]=str1; } cin>>str1; char ch; ch=getchar(); str1=""; while(1) { while(1) { scanf("%c",&ch); if(!((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')))break; str1+=ch; } if(str1=="END")break; if(mp.find(str1)==mp.end())cout<<str1; else cout<<mp[str1]; str1=""; printf("%c",ch); } return 0;}
1 0
- What are you talking about(HDU1075)
- What Are You Talking About hdu1075
- hdu1075 What Are You Talking About
- hdu1075-What Are You Talking About
- HDU1075:What Are You Talking About
- HDU1075 What Are You Talking About
- hdu1075 What Are You Talking About
- HDU1075 What Are You Talking About 【STL】
- What Are You Talking About hdu1075
- hdu1075 What Are You Talking About
- HDU1075 What Are You Talking About
- HDU1075 What Are You Talking About
- HDU1075 What Are You Talking About
- HDU1075 What Are You Talking About
- HDU1075-What Are You Talking About
- HDU1075 What Are You Talking About【MAP】
- hdu1075 What Are You Talking About-字典树
- 【字典树】 hdu1075 What Are You Talking About
- 从头认识Spring-3.3 简单的AOP日志实现-增加检查订单功能
- TCP/IP、Http、Socket的区别
- PAT--1013 Battle Over Cities(并查集)
- 利用python求解八数码难题
- 《MVC + EF+ WCF 》——批量删除数据
- HDU1075 What Are You Talking About
- Windows基础-使用XAudio2播放音频(本质是WASAPI)
- 基于百度API的开源自动翻译.srt文件软件的实现的几个技术细节总结附源代码
- elasticsearch zen discovery
- 自定义View
- swift基本语法(总结提炼版)之001常量&变量
- symfony2 如何测试与数据库交互的代码
- linux设备模型分析之bus_register()
- 成员方法