题目链接: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 ;
}

最新文章

  1. 网站上如何添加显示favicon
  2. Oracle 数据库基础学习 (七) SQL语句综合练习
  3. Oracle 释放flash recovery area的四种方法
  4. bat调用bat的一个巨坑
  5. POJ3061 尺取法
  6. 假期实践作业:从IT角度看地铁
  7. AD6电气规则错误报告中英文对照
  8. linux 环境变量设置及查看
  9. Underscore学习笔记1
  10. 编写爬虫程序的神器 - Groovy + Jsoup + Sublime
  11. LTIB常用命令2
  12. 【百度地图-安卓SDK】从头开始写android程序
  13. EdasStudio 开发工具用户手册
  14. Zabbix lld发现磁盘监控
  15. WinEdit7 破解方法
  16. Spring 注入数据源
  17. Ubuntu的shell之bash和dash
  18. codeforces——961C. Chessboard
  19. 2059 - Authentication plugin &#39;caching_sha2_password&#39; cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
  20. IO模型介绍 以及同步异步阻塞非阻塞的区别

热门文章

  1. Python中的__init__和__new__介绍
  2. 【原】flux学习笔记
  3. vim的使用
  4. IM即时通讯
  5. FBX Software Development Kit
  6. C# Pointer types
  7. Ubuntu 15.10安装KVM
  8. owin
  9. Thinkphp 连接查询的使用
  10. Loader Generator---loading图片生成器