HDOJ 题目地址:传送门

What Are You Talking About

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)
Total Submission(s): 19987    Accepted Submission(s): 6590
Problem Description
Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want to translate the history book into English. Can you help him?
Input
The problem has only one test case, the test case consists of two parts, the dictionary part and the book part. The dictionary part starts with a single line contains a string "START", this string should be ignored, then some lines follow, each line contains two strings, the first one is a word in English, the second one is the corresponding word in Martian's language. A line with a single string "END" indicates the end of the directory part, and this string should be ignored. The book part starts with a single line contains a string "START", this string should be ignored, then an article written in Martian's language. You should translate the article into English with the dictionary. If you find the word in the dictionary you should translate it and write the new word into your translation, if you can't find the word in the dictionary you do not have to translate it, and just copy the old word to your translation. Space(' '), tab('\t'), enter('\n') and all the punctuation should not be translated. A line with a single string "END" indicates the end of the book part, and that's also the end of the input. All the words are in the lowercase, and each word will contain at most 10 characters, and each line will contain at most 3000 characters.
Output
In this problem, you have to output the translation of the history book.
Sample Input
  
START from fiwo hello difh mars riwosf earth fnnvk like fiiwj END START difh, i'm fiwo riwosf. i fiiwj fnnvk! END
Sample Output
  
hello, i'm from mars. i like earth!

Hint

Huge input, scanf is recommended.

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<map>
using namespace std;
map<string,string> m;
int main(){string start,temp;cin>>start;while(cin>>start&&start!="END"){cin>>temp;m[temp]=start;}cin>>start;getchar();string a="";while(getline(cin,start)&&start!="END"){int index=0;for(int i=0;i<start.size();i++){if(islower(start[i])){a+=start[i];}else{if(m.find(a)!=m.end()){cout<<m[a];}else{cout<<a;}a="";printf("%c",start[i]);}}cout<<endl;}
}

ACM--火星文--HDOJ 1075--What Are You Talking About--map相关推荐

  1. 在线火星文转换器工具

    在线火星文转换器工具 在线火星文转换器工具 火星文(火星文:焱暒妏),趣味地意指地球人看不懂的文字,由符号.繁体字.日文.韩文.冷僻字或汉字拆分后的部分等非正规化文字符号组合而成. https://t ...

  2. 在线火星文转简体中文工具

    在线火星文转简体中文工具 在线火星文转简体中文工具 火星文(火星文:焱暒妏),趣味地意指地球人看不懂的文字,由符号.繁体字.日文.韩文.冷僻字或汉字拆分后的部分等非正规化文字符号组合而成. https ...

  3. java非主流火星文输入法_我爱火星文_火星文输入法

    火星文输入法是一款火星文即时转换软件,包含火星文转换器和繁体字转换器,支持非主流火星文转换,繁体字转换,菊花文,QQ闪字,在线转换兼容所有中文输入法,是新新人类QQ聊天的必备工具. 火星文输入法,是2 ...

  4. 16.火星文转换 C#

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _08_ ...

  5. 这些00后的“火星文”你都认识吗?证明自己是小鲜肉的时刻终于到了

    还以为自己年少轻狂, 互联网新时代的弄潮儿, 当年用QQ聊天.发说说.空间留言的 [火星文]好像还近在眼前-- 聊天还用着 3Q.886.666.2333的 "90后小鲜肉们", ...

  6. 华为OD机试 - 火星文计算 2(C++) | 附带编码思路 【2023】

    刷算法题之前必看 参加华为od机试,一定要注意不要完全背诵代码,需要理解之后模仿写出,通过率才会高. 华为 OD 清单查看地址:https://blog.csdn.net/hihell/categor ...

  7. java非主流火星文输入法_火星文转换器,火星文转换器在线转换

    火星文转换器在线转换 猫旅人 火星文是什么 火星文转换器怎么转换 你说的这个火星文其实就是一些奇形怪异的字符了,在一些个性签名还有昵称里面会经常看到的一些怪异字符,这类其实就是火星文了. 这种火星文是 ...

  8. javascript 火星文,菊花体,繁体,简体文字转换

    前言:之前在百度应用里面看到了这个过类似的工具,很想知道怎么实现的. 琢磨下,自己写了一个,效果如下. <!-------HTML CODE----------> <!DOCTYPE ...

  9. 火星文输入法?---互联网的主流与非主流

    啥东西都有,火星文输入法? 转自:http://xiaoer-1982.iteye.com/blog/693739 摘自:http://shbbs.soufun.com/1210036594~-1~1 ...

  10. 火星文转换php源码,简体/繁体/火星文转换

    require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $content = '今天天气挺好的';//utf8 $t ...

最新文章

  1. graphql_普通英语GraphQL指南
  2. 想学Python?那这套教程再适合不过了!
  3. React学习笔记二——react-router
  4. 使用webpack打包的后,公共请求路径的配置问题
  5. 【缅怀妈妈系列诗歌】之十:妈妈,孩儿答应您
  6. 目前MPLS有哪些备份方案?
  7. OpenGL实现齿轮gears联动
  8. mysql用supervisor管理_Supervisor使用详解
  9. Android Studio出现R.raw文件标红找不到错误(有多个模块的Project)
  10. 我的树莓派3配置脚本
  11. Acrobat Pro DC 教程,如何发送电子签名文件?
  12. [转] linux操作系统下c语言编程入门--基础知识
  13. java输出int_如何使打印整数函数(没有printf)输出INT_MAX
  14. 经典三层模型制作学校论坛系统(BBS)
  15. 如何快速出机械工程图
  16. oracle建表类型,oracle 建表类型以及约束
  17. C51编译出现 test.c(86): error C231: 'i2c_readbyte': redefinition
  18. Flutter 鼠标右键
  19. Bad Request This combination of host and port requires TLS. postman
  20. 班级校园网页设计作业 静态HTML我的班级网页 DW班级网站模板下载 大学生简单班级网页作品代码 我的大学网页制作 学生班级网页设计作业

热门文章

  1. multiSIM仿真软件的元件列表
  2. Java Web开发——自动刷新展示验证码图片
  3. linux-mobaxterm-yolov5训练数据集ccpd--无数踩雷后
  4. 本地安装Java环境详细步骤
  5. JS完美运动框架详解——原理分析及demo
  6. OpenGL---Windows下配置与第一个OpenGL程序
  7. 动态语言和静态语言的在面向对象编程上的差异
  8. ecstore 图片上传 图片id写入数据库
  9. C语言基础入门学习--学习笔记
  10. 2023最新SSM计算机毕业设计选题大全(附源码+LW)之java超市管理系统ztnrw