HNU 12888 Encryption(map容器)
2024-09-20 04:37:48
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12890&courseid=274
解题报告:输入一个有n个单词的句子,然后再输入这n个单词对应的意思是什么,要你翻译出这个句子最后是什么。
一个裸的map
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
#define maxn 1005
string str[maxn];
string dic[maxn][];
map<string,string> map1;
pair<map<string,string>::iterator,bool> iter;
int main()
{
int T,n;
cin>>T;
while(T--)
{
cin>>n;
for(int i = ;i <= n;++i)
cin>>str[i];
for(int i = ;i <= n;++i)
cin>>dic[i][];
for(int i = ;i <= n;++i)
cin>>dic[i][];
map1.clear();
for(int i = ;i <= n;++i)
map1.insert(pair<string,string> (dic[i][],dic[i][]));
for(int i = ;i <= n;++i)
{
if(i == n) cout<<map1[str[i]]<<endl;
else cout<<map1[str[i]]<<" ";
}
}
return ;
}
最新文章
- 网站上如何添加显示favicon
- Oracle 数据库基础学习 (七) SQL语句综合练习
- Oracle 释放flash recovery area的四种方法
- bat调用bat的一个巨坑
- POJ3061 尺取法
- 假期实践作业:从IT角度看地铁
- AD6电气规则错误报告中英文对照
- linux 环境变量设置及查看
- Underscore学习笔记1
- 编写爬虫程序的神器 - Groovy + Jsoup + Sublime
- LTIB常用命令2
- 【百度地图-安卓SDK】从头开始写android程序
- EdasStudio 开发工具用户手册
- Zabbix lld发现磁盘监控
- WinEdit7 破解方法
- Spring 注入数据源
- Ubuntu的shell之bash和dash
- codeforces——961C. Chessboard
- 2059 - Authentication plugin &#39;caching_sha2_password&#39; cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
- IO模型介绍 以及同步异步阻塞非阻塞的区别