翻译题(map使用)
What Are You Talking About
#include<iostream>
#include<map>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main()
{
map<string,string>mp;
int i=,j,k;
char s1[],s2[];
char a[];
char ch;
char buf[];
// freopen("in.txt","r",stdin);
gets(a);
while(scanf("%s",s1))
{
if(==strcmp(s1,"END"))
break;
else
{
scanf("%s",s2);
mp[s2]=s1;
}
}
getchar();
gets(a);
while(scanf("%c",&ch)==)
{
if(isalpha(ch))
{
buf[i++]=ch;
}
else
{
buf[i]='\0';
i=;
if(strcmp(buf,"END")==)
break;
if(mp.find(buf)!=mp.end())
cout<<mp[buf];
else
printf("%s",buf);
printf("%c",ch);
} }
return ;
}
翻译题(map使用)的更多相关文章
- POJ 1087 最大流裸题 + map
A Plug for UNIX Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15597 Accepted: 5308 ...
- C#LeetCode刷题-Map
Map篇 # 题名 刷题 通过率 难度 846 一手顺子 33.7% 中等 855 考场就座 20.8% 中等
- 百度之星IP聚合(水题map&字符处理)
虽然题目停水的,但是好像字符处理运用的还比较合适 Problem Description 当今世界,网络已经无处不在了,小度熊由于犯了错误,当上了度度公司的网络管理员,他手上有大量的 IP列表,小度熊 ...
- HDOJ1075字典翻译(map应用)
#include<iostream> #include<cstdio> #include<map> #include<string> #include& ...
- codeforces 659C C. Tanya and Toys(水题+map)
题目链接: C. Tanya and Toys time limit per test 1 second memory limit per test 256 megabytes input stand ...
- Gym - 101670H Go Northwest!(CTU Open Contest 2017 思维题+map)
题目: Go Northwest! is a game usually played in the park main hall when occasional rainy weather disco ...
- CF 988C Equal Sums 思维 第九题 map
Equal Sums time limit per test 2 seconds memory limit per test 256 megabytes input standard input ou ...
- 一道算法题加深我对C++中map函数的理解
一.一道题目引发我对map函数的考量 首先是题目大意:有n个银行,a[i]表示这个人在第i个银行有a[i]块钱(可以是负数),所有银行的钱加起来正好是0.每次只能在相邻的银行之间转账,问最少要转多少次 ...
- 九度OJ 1079:手机键盘 (翻译)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2279 解决:1233 题目描述: 按照手机键盘输入字母的方式,计算所花费的时间 如:a,b,c都在"1"键上,输入a只 ...
随机推荐
- Log4net 可直接使用的配置
config配置 <xml version="1.0"> <configuration> <configSections> <!--配置一 ...
- 数据的加密传输——单片机上实现TEA加密解密算法
各位大侠在做数据传输时,有没有考虑过把数据加密起来进行传输,若在串口或者无线中把所要传的数据加密起来,岂不是增加了通信的安全性.常用的加密解密算法比如DES.RSA等,受限于单片机的内存和运算速度,实 ...
- 苹果开发证书相关BLOG与Delphi IOS环境安装(超详细)
注:有好的资源,请添加了上传,上传后,通知管理员,删除旧文件,累积相关的学习资源,方便新手学习 一.相关论坛http://www.2ccc.com/ delphi 合子 www.2pascal.com ...
- Http响应报文
HTTP响应也由三个部分组成,分别是:状态行.消息报头.响应正文. 其中,HTTP-Version表示服务器HTTP协议的版本:Status-Code表示服务器发回的响应状态代码:Reason-Phr ...
- MongoDB C Driver and APIinstances linux MongoDB安装配置
<一,linux平台MongoDB安装配置>在这我们使用的Centos6 yum部署的,你想搞编译,自个干!
- A canvas fillText and strokeText example
A canvas fillText and strokeText example A canvas fillText and strokeText example
- poj 2356 Find a multiple(鸽巢原理)
Description The input contains N natural (i.e. positive integer) numbers ( N <= ). Each of that n ...
- IOS 下雪动画
#define SNOW_IMAGENAME @"snow" #define IMAGE_X arc4random()%(int)Main_Screen_Width #define ...
- Spring的MethodInvokingFactoryBean
通过MethodInvokingFactoryBean 可以向某静态方法注入参数. 如: <bean class="org.springframework.beans.factory. ...
- 第八届郑州轻工业学院ACM(程序设计大赛)校内预选赛
郑州轻工业学院有一个大赛,把几个有趣的题目分享一下.下面是题目连接,喜欢了就点点... 斗破苍穹 礼上往来 统计人数 神の数 炉石传说 Mathematics and Geometry 马拉松后记 斗 ...