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 ...
随机推荐
- ubuntu下的c/c++环境搭建
原文地址:http://www.cnblogs.com/hitwtx/archive/2011/12/03/2274556.html ubuntu下的c/c++环境搭建是比较简单,因为有apt和新立得 ...
- Python一路走来 线程 进程
Python线程 Threading用于提供线程相关的操作,线程是应用程序中工作的最小单元. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #!/usr/bin/env pytho ...
- C程序设计语言练习题1-11
练习1-11 你准备如何测试单词计数程序?如果程序中存在某种错误,那么什么样的输入最可能发现这类错误呢? 代码如下: #include <stdio.h> // 包含标准库的信息. #de ...
- 来,试试PERL
试试,看看能否真的替代AWK,SED这些的... #!/usr/bin/perl print "hello, world!\n"; $line = <STDIN>; i ...
- LeetCode_sqrt(x)
class Solution { public: int sqrt(int x) { // Start typing your C/C++ solution below // DO NOT write ...
- jQuery自定义函数验证邮箱格式
jQuery.fn.checkEmail = function() { // 自定义jQuery方法 var email_val = $(this).val(); reg = /^\w+([-+.]\ ...
- 黑马程序员_Java_String
String类 一.概述 字符串是一个特殊的对象. 字符串一旦初始化就不可以被改变. String s1 = "abc";//s1是一个类类型变量,"abc"是 ...
- hdu4622-Reincarnation(后缀自动机)
Problem Description Now you are back,and have a task to do:Given you a string s consist of lower-cas ...
- MyBatis映射文件的resultMap如何做表关联
MyBatis的核心是其映射文件,SqlMap文件,里面配置了项目中用到了什么SQL语句,和数据库相关的逻辑都在这个映射文件里.顾名思义,映射文件就是对Java对象和SQL的映射.这里简单介绍一下映射 ...
- Excel2010 柱形图与折线图制表
示例1: 数据格式 问题:现在要用柱形图表示手机网民数和年增长率,横轴表示年份,纵轴(1)表示手机网民数,纵轴折线图(2)表示年增长率,要做在一个图表中,请问该怎么做? 步骤: 1.选择A/B/C所在 ...