zoj 1109 Language of FatMouse
2011-12-27 18:31
260 查看
#include "iostream" #include "string" #include "map" using namespace std; int main() { map<string, string> m; string str1, str2; while (getline(cin, str1) && str1 != "")//从行输入中分隔两个字符串出来! { int length, size; string temp1 = "", temp2 = ""; size = str1.size(); length = str1.find(' '); for (int i = 0; i < length; i++) temp1 += str1[i]; for (int j = length + 1; j < size; j++) temp2 += str1[j]; m.insert(pair<string, string>(temp2, temp1)); } while (cin >> str2) { if (m.find(str2) != m.end())//在映射器中查找的结果 cout << m[str2] << endl; else cout << "eh" << endl; } }
相关文章推荐
- zoj 1109 : Language of FatMouse
- ZOJ1109 Language of FatMouse
- ZOJ 1109 Language of FatMouse
- zoj 1109 Language of FatMouse
- ZOJ 1109 Language of FatMouse
- zoj 1109 Language of FatMouse
- zoj 1109 : Language of FatMouse
- ZOJ 1109 Language of FatMouse (trie树)
- zoj 1109 Language of FatMouse
- zoj1109 水题(大神绕道) Language of FatMouse
- ZOJ 1109 Language of FatMouse
- zoj 1109 zoj 1109 Language of FatMouse(字典树)
- ZOJ1109_Language of FatMouse(STL/map)
- zoj1109-Language of FatMouse 字典树
- ZOJ 1109 Language of FatMouse
- zoj 1109 Language of FatMouse(map)
- zoj 1109 Language of FatMouse(字典树)
- ZOJ 1109 Language of FatMouse 【STL】
- ZOJ Problem Set - 1109 Language of FatMouse
- 字典树例题介绍:ZOJ 1109 Language of FatMouse,HDOJ 1075hdoj What Are You Talking About