ZOJ 1181Word Amalgamation
来源:互联网 发布:金税盘数据导出 编辑:程序博客网 时间:2024/06/05 08:20
segmentation fault。弄不懂。
//1181Word Amalgamation#include <iostream>#include <stdio.h>#define FILE_DEBUG//#define _C_LAN_#ifdef FILE_DEBUG#include <fstream>#endifusing namespace std;#include <string>#include <map>#include <algorithm>int main(int argc, char *argv[]){#ifdef FILE_DEBUGifstream fin;fin.open("input.txt");cin.rdbuf(fin.rdbuf()); // assign file's streambuf to cin#ifdef _C_LAN_freopen("input.txt", "r", stdin);#endif#endif#ifdef FILE_DEBUGofstream fout;fout.open("output.txt");cout.rdbuf(fout.rdbuf()); // assign file's streambuf to cout#ifdef _C_LAN_freopen("output.txt", "w", stdout);#endif#endif string str_tmp, sort_tmp; multimap<string, string> dict; multimap<string, string>::iterator it; map<string, int> dict_out; map<string, int>::iterator m_it; while (cin >> str_tmp && str_tmp.compare("XXXXXX") != 0) { sort_tmp = str_tmp; sort(sort_tmp.begin(), sort_tmp.end()); dict.insert(pair<string, string> (sort_tmp, str_tmp)); } while (cin >> str_tmp && str_tmp.compare("XXXXXX") != 0) { if (dict.size() <= 0) continue; sort(str_tmp.begin(), str_tmp.end()); it = dict.find(str_tmp); if (it == dict.end()) { cout << "NOT A VALID WORD" << endl; } else { dict_out.clear(); while (it->first.compare(str_tmp) == 0) { dict_out.insert(pair<string, int> (it->second, 0)); it ++; } if (dict_out.size() > 0) { for (m_it = dict_out.begin(); m_it != dict_out.end() ; m_it ++) { cout << m_it->first << endl; } } } cout << "******" << endl; } return 0;}
- ZOJ 1181Word Amalgamation
- ZOJ 1181 Word Amalgamation
- zoj 1181 Word Amalgamation
- ZOJ 1181 Word Amalgamation(单词融合)
- Word Amalgamation
- Word Amalgamation
- Word Amalgamation
- Word Amalgamation源程序
- fjnu 1147 Word Amalgamation
- POJ1318 Word Amalgamation
- POJ 1318 Word Amalgamation
- POJ 1318 Word Amalgamation
- poj 1318 Word Amalgamation
- 1318 Word Amalgamation
- POJ 1113 Word Amalgamation
- HDU 1113 Word Amalgamation
- POJ 1318 Word Amalgamation
- UVA 642 - Word Amalgamation
- 课程设计两连发之局域网通讯软件
- java static总结
- 2000-2010 十大最具技术影响力产品(国内)
- LoadRunner测试Flex
- 从零开始学.net多线程系列(三)——同步
- ZOJ 1181Word Amalgamation
- 获取拼音码 sql函数
- 代码疑云
- 第七篇博客:水印图片和水印文字
- B、Bit、Byte
- 张亚勤:天才也不会随随便便成功
- 项目经理的核心能力
- 视频画刷VideoBrush
- 如何成为最好的工程师---吴军讲座学习笔记