HDU 1113(map的使用)
来源:互联网 发布:php服务器怎么绑定域名 编辑:程序博客网 时间:2024/05/29 16:28
题意:给一串字符串字典,再给一串字符串,求字典中是否存在与字符串字符相同的字符串。
#include <iostream>#include <string>#include <map>#include <algorithm>using namespace std;void main(){ map<string, string> dictionary; string s, t; while (cin >> s && s != "XXXXXX") { t = s; sort(s.begin(), s.end()); dictionary[t] = s; } while (cin >> s && s != "XXXXXX") { int flag = 0; t = s; sort(s.begin(), s.end()); map<string, string>::iterator it; for (it = dictionary.begin(); it != dictionary.end(); ++it) { if (it->second == s) { cout << it->first << endl; flag = 1; } } if (!flag) { cout << "NOT A VALID WORD" << endl; } cout << "******" << endl; }}
0 0
- HDU 1113(map的使用)
- hdu 4941 map的使用
- hdu 1004 map的使用
- hdu 2648(Shopping) STL map的使用
- hdu 1251 统计难题 (Map的使用)
- HDU 1004map的初步使用
- HDU 1004 map使用
- hdu 2112 HDU Today(map与dijkstra的结合使用)
- HDU-1113-STL的map<string,string>
- hdu 1029 Ignatius and the Princess IV //map的使用
- HDU 1082 Matrix Chain Multiplication(栈和map的使用)
- hdu 1263 水果(map的使用2)
- HDU 6015 Skip the Class 优先队列 map的使用
- HDU 1228 A + B(map的简单使用)
- 【Map】Map.Entry的使用
- HDU 2648 map的应用
- hdu 4941map的运用
- HDU 4287 map的用法
- 如何连接oracle数据库及故障解决办法
- 高精度计时器
- LearnVSXNow! #8 插曲-regpkg.exe命令
- 跨服务器上传图片
- linux下修改主机名
- HDU 1113(map的使用)
- 获取android多个sd卡路径的方法
- 第二章 链路层 2.2以太网和IEEE 802封装
- POJ 2488 A Knight's Journey
- 图片异步加载
- 这些事,我不作,别人也会作
- LearnVSXNow! #9 - 创建我们第一个工具集-重构为服务
- directshow+wince6.0+pxa310+双camera
- memset