hdu 1075 What Are You Talking About STL的使用
来源:互联网 发布:我想做淘宝客怎么弄 编辑:程序博客网 时间:2024/04/29 08:44
STL 的map容器使用
题意:给你一些单词的对应表,然后给你一些句子,输出句子,并把句子中与单词对应表中相对应的单词输出
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<algorithm>#include<iostream>#include<map>using namespace std;map<string,string> mp;int main(){ string s1,s2; map<string,string>::iterator iter; char ch; while(cin>>s1) { mp.clear(); while(true) { cin>>s1; if(s1=="END")break; cin>>s2; mp[s2]=s1; } cin>>s1; getchar(); while(true) { s2=""; while(scanf("%c",&ch)!=EOF) { if(ch=='\n'&&s2=="END") return 0; if(ch=='\n') break; if(!isalpha(ch)) { iter=mp.find(s2); if(iter!=mp.end())cout<<iter->second; else cout<<s2; cout<<ch; s2=""; } else s2+=ch; } printf("\n"); } } return 0;}
0 0
- hdu 1075 What Are You Talking About STL的使用
- HDU-1075 What Are You Talking About (STL:map)
- HDU 1075:What Are You Talking About【字典树 & STL】
- hdu 1075 What Are You Talking About
- HDU 1075 What Are You Talking About
- HDU 1075 What Are You Talking About
- HDU-1075 What Are You Talking About
- hdu 1075 What Are You Talking About
- hdu 1075 What Are You Talking About
- hdu 1075 What Are You Talking About
- HDU-1075-What Are You Talking About
- HDU 1075 What Are You Talking About
- HDU 1075 What Are You Talking About
- hdu 1075 What Are You Talking About
- Hdu 1075 What Are You Talking About
- hdu 1075 What Are You Talking About
- hdu 1075 What Are You Talking About
- HDU 1075 What Are You Talking About
- linux Makefile
- 大数据对象
- (C)理解 #define write(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
- lucene源码分析---1
- javascript浏览器对象(window对象)——Screen对象
- hdu 1075 What Are You Talking About STL的使用
- vim速查手册(随时更新)
- CSS层叠样式表(Cascading Style Sheets)
- 2016年下半年
- ViewPager+RadioGroup实现微信UI界面
- java list倒序输出及复制list集合
- 【机器学习】常见算法分类汇总
- Failed to load the JNI shared library
- 从写博客开始