Description

This is a true story. A man showed his love to a girl,but the girl didn't replied clearly ,just gave him a Morse Code: 
****-/*----/----*/****-/****-/*----/---**/*----/****-/*----/-****/***--/****-/*----/----*/**---/-****/**---/**---/***--/--***/****-/   He was so anxious that he asked for help in the Internet and after one day a girl named "Pianyi angel" found the secret of this code. She translate this code as this five steps: 
1.First translate the morse code to a number string: 4194418141634192622374
2.Second she cut two number as one group 41 94 41 81 41 63 41 92 62 23 74,according to standard Mobile phone can get this alphabet:GZGTGOGXNCS

3.Third she change this alphabet according to the keyboard: QWERTYUIOPASDFGHJKLZXCVBNM = ABCDEFGHIJKLMNOPQRSTUVWXYZ
So ,we can get OTOEOIOUYVL
4.Fourth, divide this alphabet to two parts: OTOEOI and OUYVL, compose again.we will get OOTUOYEVOLI
5.Finally,reverse this alphabet the answer will appear : I LOVE YOU TOO

I guess you might worship Pianyi angel as me,so let's Orz her. 
Now,the task is translate the number strings. 
 

Input

A number string each line(length <= 1000). I ensure all input are legal.
 

Output

An upper alphabet string.
 

Sample Input

4194418141634192622374
41944181416341926223
 

Sample Output

ILOVEYOUTOO
VOYEUOOTIO
 
 
 
 
 
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std; int main()
{
char ss[],s[];
char* a[]={"ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ"};
char b[]="KXVMCNOPHQRSZYIJADLEGWBUFT";
char d[]="QWERTYUIOPASDFGHJKLZXCVBNM";
//for(int i=0;i<26;i++)
// cout<<b[d[i]-'A']<<" ";
while(gets(ss))
{
int m=strlen(ss);
int len=;
for(int i=;i<m;i++)
if(ss[i]!=' ')
s[len++]=ss[i];
char s0[];
int x=;
for(int i=;i<len;i+=)
{
s0[x++]=b[a[s[i]-''][s[i+]-'']-'A']; }
char s1[];
int y=;
for(int i=;i<x;i+=)
{
s1[i]=s0[y++];
}
for(int i=;i<x;i+=)
{
s1[i]=s0[y++];
}
for(int i=y-;i>=;i--)
{
putchar(s1[i]);
}
printf("\n");
}
}
 

I Love You Too HDU 2816的更多相关文章

  1. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

  2. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  3. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  4. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  5. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  6. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  7. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  8. hdu 4481 Time travel(高斯求期望)(转)

    (转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...

  9. HDU 3791二叉搜索树解题(解题报告)

    1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...

随机推荐

  1. GridView Footer页脚统计实现多行

    在使用GridView时有时会需要多行显示页脚Footer的统计,下面是一种解决方法,仅仅供各位参考 在GridView的RowCreated事件中添加多行页脚,实例代码如下: protected v ...

  2. 解决div里面img的缝隙问题~

    解决div里面img的缝隙问题 图片IMG与容器下边界之间有空隙怎么办?这里介绍3中简单的解决方法. 第一,给图片img标签display:block. img{display:block} 第二,定 ...

  3. PHP 函数dirname()使用实例

    通常在配置文件路径的时候用dirname(__FILE__)是非常有效的方法,但是因为__FILE__的路径是当前代码所在文件(而不是url所在文件)完整路径,所以定义配置文件通常要放在根目录下定义网 ...

  4. linux下环境搭建比较

    xampp是一款初学者使用的集成的apache mysql与php配置安装包了,我们可以利用xampp来快速安装配置php环境,下面一起来看看吧.   要在linux服务器上面挂我们的php网站程序, ...

  5. Linux_access the file or directory which start with "-"

    cd -- filename/dirName [ccmobil@vm-a65a-fc19 wstemp]$ cd -/ -bash: cd: -: invalid option cd: usage: ...

  6. 关于取url或者微信中参数的js

    今天遇到这么个情况,因为是第一次弄,所以在这里做了个记录,因为要弄过二维码的功能,要获取里面的参数并传给后台,所以要对二维码里面的地址进行过滤.刚开始是很惆怅的,因为之前没弄过,原以为可以通过spli ...

  7. ssm+jsp+自定义标签实现分页,可以通用(后端实现)

    从controller到mapper.xml的后端实现 只梳理分页相关代码 1 controller里面相关 ModelAndView mv = new ModelAndView("/lis ...

  8. Codeforces 527D Clique Problem

    http://codeforces.com/problemset/problem/527/D 题意:给出一些点的xi和wi,当|xi−xj|≥wi+wj的时候,两点间存在一条边,找出一个最大的集合,集 ...

  9. Android 得到当前已连接的wifi的信号强度

    1.得到当前已连接的wifi信息 WifiManager wifi_service = (WifiManager)getSystemService(WIFI_SERVICE); WifiInfo wi ...

  10. SeekBar.OnSeekBarChangeListener解析

    public static interface SeekBar.OnSeekBarChangeListener android.widget.SeekBar.OnSeekBarChangeListen ...