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 ...
随机推荐
- First non repeating word in a file? File size can be 100GB.
1 solution 1 1.1 数据结构 一个Hashmap和一个双向链表.如果想要快速获取first,并且只遍历一次,那么就要想到双向链表和HashMap的组合. 链表可以保证第一个在head处, ...
- GCD多线程在swift中的变化
1.异步线程加载主线程刷新 DispatchQueue.global().async { // TODO:执行异步线程网络请求 DispatchQueue.main.async(execute: { ...
- Android笔记之使用Glide加载网络图片、下载图片
Glide简介 不想说太多,真的很方便:P)可以节省我不少时间 GitHub地址:https://github.com/bumptech/glide 加载网络图片到ImageView Glide.wi ...
- bd存储
var sessionData = new Array();var setSessionData=function(key,val){ if(sessionStorage){ sessionStora ...
- python基础8 -----迭代器和生成器
迭代器和生成器 一.迭代器 1.迭代器协议指的是对象必须提供一个next方法,执行该方法要么返回迭代中的下一项,要么就引起一个StopIteration异常,以终止迭代 (只能往后走不能往前退) 2. ...
- mathjax
MathJax.Hub.Typeset() method. This will cause the preprocessors (if any were loaded) to run over the ...
- python 3 面向过程编程
python 3 面向过程编程 核心是过程(流水线式思维),过程即解决问题的步骤,面向过程的设计就像设计好一条工业流水线,是一种机械式的思维方式. 1.优点:程序结构清晰,可以把复杂的问题简单化,流程 ...
- render总结
vue渲染组件的顺序是: 执行render函数-->没有render参数解析template参数内容-->没有template参数将el内html当做template解析 其中解析temp ...
- hd acm1466
http://www.cnblogs.com/alihenaixiao/p/4107907.html#undefined.这个博客有详解,我这个只是写一些·自己的总结. 问题:平面上有n条直线,且无三 ...
- web应用组成结构,web.xml的作用