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 5.6 root密码丢失,使用mysqld --skip-grant-tables
MySQL 5.6 root密码丢失,(window平台)使用mysqld –skip-grant-tables启动MySQL服务,出现警告: 1 [Warning] TIMESTAMP with i ...
- Android学习笔记--AlertDialog应用
1. 自定义实现带图标的TextView IconTextView.java package com.evor.andtest; import android.content.Context; imp ...
- contentSize、contentInset和contentOffset区别
contentSize.contentInset和contentOffset区别 分类: iphone开发2011-12-05 21:49 23495人阅读 评论(4) 收藏 举报 uiviewios ...
- [SQL注入1]From SQL injection to Shell
第一次写,希望大神们多指点. 对于刚接触WEB渗透测试这块的朋友们,很希望能有个平台可以练习.网络上有不少,十大渗透测试演练系统,我这里推荐一个在10以外,适合初学者一步一步进步的平台PENTESTE ...
- Android窗口管理服务WindowManagerService计算Activity窗口大小的过程分析
来自http://blog.csdn.net/luoshengyang/article/details/8479101 在Android系统中,Activity窗口的大小是由WindowManager ...
- 如何用VS2010打开VS2012编辑的项目
找到打开项目的开始图标:,右键点击,选择有文本编辑器打开,用下面的语句将文件里面的前两句替换掉.Microsoft Visual Studio Solution File, Format Versi ...
- PlayerPrefs类
该类用于本地持久化保存与读取数据工作原理是:以键值对的形势将数据保存在文件中.该类可以保存与读取3种基本的数据类型,它们是浮点型.整型和字符串型,涉及的方法如下.SetFloat():保存浮点类型Se ...
- 程序错误[C/C++]
对于初学者而言,一般意义上,程序错误可以分为两类,逻辑错误和非逻辑错误.前者是指,程序可以通过编译或链接但运行时不符合预期结果,后者是程序不能通过编译或链接. 乍一看这样的分类非常清楚.不过,当引入语 ...
- android 遍历所有文件夹和子目录搜索文件
java代码: import java.io.File; import android.app.Activity; import android.os.Bundle; import android.v ...
- 【转】Win7与Ubuntu 14.04双系统修改启动项顺序
原文网址:http://blog.sina.com.cn/s/blog_b381a98e0102v1gy.html 一.Ubuntu14.04采用默认安装方式的情况 采用默认安装方式,在win7下安装 ...