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
 
 
 
 
 
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<algorithm>
  5. #include<cmath>
  6. #include<queue>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. char ss[],s[];
  12. char* a[]={"ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ"};
  13. char b[]="KXVMCNOPHQRSZYIJADLEGWBUFT";
  14. char d[]="QWERTYUIOPASDFGHJKLZXCVBNM";
  15. //for(int i=0;i<26;i++)
  16. // cout<<b[d[i]-'A']<<" ";
  17. while(gets(ss))
  18. {
  19. int m=strlen(ss);
  20. int len=;
  21. for(int i=;i<m;i++)
  22. if(ss[i]!=' ')
  23. s[len++]=ss[i];
  24. char s0[];
  25. int x=;
  26. for(int i=;i<len;i+=)
  27. {
  28. s0[x++]=b[a[s[i]-''][s[i+]-'']-'A'];
  29.  
  30. }
  31. char s1[];
  32. int y=;
  33. for(int i=;i<x;i+=)
  34. {
  35. s1[i]=s0[y++];
  36. }
  37. for(int i=;i<x;i+=)
  38. {
  39. s1[i]=s0[y++];
  40. }
  41. for(int i=y-;i>=;i--)
  42. {
  43. putchar(s1[i]);
  44. }
  45. printf("\n");
  46. }
  47. }
 

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. MySQL 5.6 root密码丢失,使用mysqld --skip-grant-tables

    MySQL 5.6 root密码丢失,(window平台)使用mysqld –skip-grant-tables启动MySQL服务,出现警告: 1 [Warning] TIMESTAMP with i ...

  2. Android学习笔记--AlertDialog应用

    1. 自定义实现带图标的TextView IconTextView.java package com.evor.andtest; import android.content.Context; imp ...

  3. contentSize、contentInset和contentOffset区别

    contentSize.contentInset和contentOffset区别 分类: iphone开发2011-12-05 21:49 23495人阅读 评论(4) 收藏 举报 uiviewios ...

  4. [SQL注入1]From SQL injection to Shell

    第一次写,希望大神们多指点. 对于刚接触WEB渗透测试这块的朋友们,很希望能有个平台可以练习.网络上有不少,十大渗透测试演练系统,我这里推荐一个在10以外,适合初学者一步一步进步的平台PENTESTE ...

  5. Android窗口管理服务WindowManagerService计算Activity窗口大小的过程分析

    来自http://blog.csdn.net/luoshengyang/article/details/8479101 在Android系统中,Activity窗口的大小是由WindowManager ...

  6. 如何用VS2010打开VS2012编辑的项目

    找到打开项目的开始图标:,右键点击,选择有文本编辑器打开,用下面的语句将文件里面的前两句替换掉.​Microsoft Visual Studio Solution File, Format Versi ...

  7. PlayerPrefs类

    该类用于本地持久化保存与读取数据工作原理是:以键值对的形势将数据保存在文件中.该类可以保存与读取3种基本的数据类型,它们是浮点型.整型和字符串型,涉及的方法如下.SetFloat():保存浮点类型Se ...

  8. 程序错误[C/C++]

    对于初学者而言,一般意义上,程序错误可以分为两类,逻辑错误和非逻辑错误.前者是指,程序可以通过编译或链接但运行时不符合预期结果,后者是程序不能通过编译或链接. 乍一看这样的分类非常清楚.不过,当引入语 ...

  9. android 遍历所有文件夹和子目录搜索文件

    java代码: import java.io.File; import android.app.Activity; import android.os.Bundle; import android.v ...

  10. 【转】Win7与Ubuntu 14.04双系统修改启动项顺序

    原文网址:http://blog.sina.com.cn/s/blog_b381a98e0102v1gy.html 一.Ubuntu14.04采用默认安装方式的情况 采用默认安装方式,在win7下安装 ...