hdoj1113(字符串map应用)
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<map>
#include<algorithm>
using namespace std;
#define END "XXXXXX"
const int SIZE=+;
map<string, string> dic; void Fun_in()
{
string s;
while(cin>>s&&s.compare(END))
{
string t=s;
sort(t.begin(),t.end());
dic[s]=t;
}
} void Fun_out()
{
string word;
while(cin>>word&&word.compare(END))
{
bool flag=false;
string t=word;
sort(t.begin(),t.end());
for(map<string, string>:: iterator it=dic.begin();it!=dic.end();it++)
{
if(!it->second.compare(t))
{
flag=true;
cout<<it->first<<endl;
}
} if(!flag)
cout<<"NOT A VALID WORD"<<endl; cout<<"******"<<endl; } } int main()
{
Fun_in();
Fun_out(); return ;
}
hdoj1113(字符串map应用)的更多相关文章
- java中json包的使用以及字符串,map,list,自定义对象之间的相互转换
做一个map和字符串的转换,需要导入这些jar包,这是最基本的一些jar包. 经过多方尝试得出结论入下: 首先导入基本包:json-lib-2.2.3-jdk15.jar 如果没有这个jar包,程序是 ...
- TTTTTTTTTTTTTTTTTT CodeForces 589A Email Aliases 字符串 map
A - Email Aliases Time Limit:2000MS Memory Limit:524288KB 64bit IO Format:%I64d & %I64u ...
- react FileReader读取TXT文件并保存 split切割字符串 map()分别渲染切割后的数组内的所有字符串
//class my_fileReader( e ) { console.log(e.target.files[0]); const reader = new File ...
- Springboot---显示图片/字符串/map集合/list集合
1.字符串/图片/map集合 @GetMapping("/hello") public String test(Model model){ String message=" ...
- [转]解析json:与array,list,map,bean,xml相互转化
一.解析json之net.sf.json 下载地址 使用netsfjson需要导入的包 JSONObject JSONArray JavaBean与json字符串互转 List与json字符串互转 M ...
- Map 对象
1.创建一个Map对象 var map=new Map(); 2.size属性 //给map添加一些值 map.set("name","张三"); map.se ...
- Set 和 Map 数据结构
Set Set 对象允许你存储任何类型的 唯一值, 无论是 原始值(一共6种,string, number, boolean, undefined, null,和 es6 新增的 symbol) 还是 ...
- fastjson java类、字符串、jsonObject之前的转换
json对象转成json字符串 JSONObject json = new JSONObject(); json.put("page",1); json.put("pag ...
- java json与map互相转换(二)
java json与map互相转换(二) CreationTime--2018年7月16日15点09分 Author:Marydon 1.准备工作 所需jar包: commons-beanutil ...
随机推荐
- transport connector和network connector
1 什么是transport connector 用于配置activemq服务器端和客户端之间的通信方式. 2 什么是network connector 用于配置activemq服务器之间的通信方式, ...
- 【python】-- try except (异常捕获)、断言
try except (异常捕获) 当程序出错了,但是我们又不想让用户看到这个错误,而且我在写程序的时候已经预料到了它可以出现这样的错误,出现这样的错误代表着什么,我们可以提前捕获这些个错误 1.异常 ...
- python初学者总结
学习python首先配置好工作环境,因为不同版本之间的python是不兼容了 原创:01coding.com win7安装环境过程: 1:下载python 建议下载两个不同版本官方已给出 https: ...
- Google的Guava之IO升华
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/luo201227/article/details/36413279 程序员在开发过程中,使用文件的几 ...
- python 统计单词出现次数
#use python3.6 import re from collections import Counter FILESOURCE = './abc.txt' def getMostCommonW ...
- iOS 读取本地Json文件
之前写过类似的方法 今天写这个 的目的是 应对开发过程中面对 服务端数据刚定下模型 但是接口不通 的情况下 不耽误客户端开发进度 + (id)getJsonDataJsonname:(NSString ...
- Redis的管理
一.redis持久化 redis是内存数据库,一切的数据都是存储到内存中的,我们知道,当服务器意外关机,那么在内存中的数据都将丢失,但是redis为我们提供持久化功能,这样就能把数据保存到硬盘上.re ...
- python3 mysql 多表查询
python3 mysql 多表查询 一.准备表 创建二张表: company.employee company.department #建表 create table department( id ...
- Python 3 常用模块之 一
Python 3 模块 一. time模块 时间模块 在Python中,通常有这几种方式来表示时间: 1.1 时间戳(timestamp): 通常来说,时间戳表示的是从1970年1月1日00:00: ...
- B表中的pid对应A表中id,查询A表中数据,根据b表中对应a表中该id的数据数目排序
B表中的pid对应A表中id,查询A表中数据,根据b表中对应a表中该id的数据数目排序 select a.*,count(*) as c from a left join b on a.id=b.ai ...