I Love You Too HDU 2816
Description
****-/*----/----*/****-/****-/*----/---**/*----/****-/*----/-****/***--/****-/*----/----*/**---/-****/**---/**---/***--/--***/****-/ 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
Output
Sample Input
41944181416341926223
Sample Output
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的更多相关文章
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 4006The kth great number(K大数 +小顶堆)
The kth great number Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64 ...
- HDU 1796How many integers can you find(容斥原理)
How many integers can you find Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d ...
- hdu 4481 Time travel(高斯求期望)(转)
(转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...
- HDU 3791二叉搜索树解题(解题报告)
1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...
随机推荐
- 初学mysql命令
创建数据库mydb: create database mydb; 运行sql脚本文件:(连接数据库后) \. e:\myphpWeb\createTables.sql 删除数据库mydb: drop ...
- 菜鸟做HTML5小游戏 - 刮刮乐
继上篇翻翻乐之后,又来刮刮乐.还是先上效果图: 开始demo的世界: 1.css去绘制界面效果.(源码提供) 2.原理:要实现刮刮卡内容的出现,我用div做了背景层去显示刮出的内容结果[重点].中间C ...
- linux清理僵尸进程
查看服务器时发现好3个僵尸进程,僵尸进程存在好多天了,一直不会处理,留到了今天,顺便清理下僵尸进程吧 top命令中统计了僵尸进程,是第二行最后一项3 zombie. 或者使用下面的命令得到僵尸进程数量 ...
- javascript闭包作用
闭包的简单概念:闭包就是能够读取其他函数内部变量的函数. 函数内部的函数闭包的两个最大的作用读取函数内部的变量变量的值始终保持在内存中function A(){ var n=999; nAdd=fun ...
- Python入门-----介绍
摘要:Python语言的特点 ----->优雅.明确.简单 一.Python适合的领域 web网站和各种网络服务 系统工具和脚本 作为“胶水”语言,把其他语言开发的模块包装起来方便使用 二.Py ...
- iOS平台在ffmpeg中使用librtmp
转载请注明出处:http://www.cnblogs.com/fpzeng/p/3202344.html 系统版本:OS X 10.8 一.在iOS平台上交叉编译librtmp librtmp lin ...
- 继网易博客后搜狐博客也增加了nofollow标签
继网易博客后搜狐博客也增加了nofollow标签 今天在搜狐博客发表了篇文章,在末端添加上我的版权,结果回头查看是发现,这个锚文本被加上了nofollow标签,也就是说这样的外链已经没有传递权重的作用 ...
- cf C. Insertion Sort
http://codeforces.com/contest/362/problem/C #include <cstdio> #include <cstring> #includ ...
- Unity3D中C#编写脚本
1.继承MonoBehaviour类:任何一个游戏脚本都需要去继承MonoBehaviour这个类,只是在创建javascript脚本的时候,系统会将其类名与继承关系隐藏起来. 2.声明变量:使用Ja ...
- UltraEdit-32 恢复到初始默认配置
不小心把UltraEdit-32搞乱了,字体不管怎么设置,都回不去了..然后那些菜单也被弄得乱七糟八的....于是就想把这些设置都搞成默认的.重装UltraEdit-32.清理注册表.结果发现都没有用 ...