HYSBZ 2145 悄悄话
2145: 悄悄话
Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 271 Solved: 104
[Submit][Status][Discuss]
Description
在这个有话不直说的年代,密码学越来越被广泛接受。我们引用经典的“凯撒密码”。在英文中,凯撒加密只对26个字母生效(分大小写)我们按照a到z来排字母。凯撒加密的原理就是把原文的每一个字母都按顺序往后移K位。这个K将被作为密钥。(’a’往后移变成’b’,’z’往后移会变成’a’) (0< = K< = 25)现在给出一系列用凯撒加密的英文句子,请你编写程序逐句翻译。也就是说,请你确定一个密钥,使得解码以后的文字最符合英文的规则与规范。数据保证存在唯一的解码方案,使得明码是完全可以分辨的英文句子。
Input
输入一定包括10行每一行都是用同一密钥加密的英文。
Output
输出10行,为解密结果。不允许格式上有任何不同。
Sample Input
Welcome to the test. This is the 1st sample test case.
Vdkbnld sn sgd sdrs. Sghr hr sgd 2mc rzlokd sdrs bzrd.
Welcome to the test. This is the 3rd sample test case.
Nvctfdv kf kyv kvjk. Kyzj zj kyv 4ky jrdgcv kvjk trjv.
Govmywo dy dro docd. Drsc sc dro 5dr ckwzvo docd mkco.
Nvctfdv kf kyv kvjk. Kyzj zj kyv 6ky jrdgcv kvjk trjv.
Jrypbzr gb gur grfg. Guvf vf gur 7gu fnzcyr grfg pnfr.
Ucjamkc rm rfc rcqr. Rfgq gq rfc 8rf qyknjc rcqr ayqc.
Ckriusk zu znk zkyz. Znoy oy znk 9zn ygsvrk zkyz igyk.
Xfmdpnf up uif uftu. Uijt jt uif mbtu tbnqmf uftu dbtf.
Vdkbnld sn sgd sdrs. Sghr hr sgd 2mc rzlokd sdrs bzrd.
Welcome to the test. This is the 3rd sample test case.
Nvctfdv kf kyv kvjk. Kyzj zj kyv 4ky jrdgcv kvjk trjv.
Govmywo dy dro docd. Drsc sc dro 5dr ckwzvo docd mkco.
Nvctfdv kf kyv kvjk. Kyzj zj kyv 6ky jrdgcv kvjk trjv.
Jrypbzr gb gur grfg. Guvf vf gur 7gu fnzcyr grfg pnfr.
Ucjamkc rm rfc rcqr. Rfgq gq rfc 8rf qyknjc rcqr ayqc.
Ckriusk zu znk zkyz. Znoy oy znk 9zn ygsvrk zkyz igyk.
Xfmdpnf up uif uftu. Uijt jt uif mbtu tbnqmf uftu dbtf.
Sample Output
Welcome to the test. This is the 1st sample test case.
Welcome to the test. This is the 2nd sample test case.
Welcome to the test. This is the 3rd sample test case.
Welcome to the test. This is the 4th sample test case.
Welcome to the test. This is the 5th sample test case.
Welcome to the test. This is the 6th sample test case.
Welcome to the test. This is the 7th sample test case.
Welcome to the test. This is the 8th sample test case.
Welcome to the test. This is the 9th sample test case.
Welcome to the test. This is the last sample test case.
【数据说明】
数据将从不同的方面考察。请尽量保证程序的准确性。
每一行长度不会太短(不少于3个单词的完整句)。没有全角字符和其他语言符号,可能包含半角空格和标点。
单个测试点不超过5kB。
Welcome to the test. This is the 2nd sample test case.
Welcome to the test. This is the 3rd sample test case.
Welcome to the test. This is the 4th sample test case.
Welcome to the test. This is the 5th sample test case.
Welcome to the test. This is the 6th sample test case.
Welcome to the test. This is the 7th sample test case.
Welcome to the test. This is the 8th sample test case.
Welcome to the test. This is the 9th sample test case.
Welcome to the test. This is the last sample test case.
【数据说明】
数据将从不同的方面考察。请尽量保证程序的准确性。
每一行长度不会太短(不少于3个单词的完整句)。没有全角字符和其他语言符号,可能包含半角空格和标点。
单个测试点不超过5kB。
HINT
__EOF__

本文作者:shenben
本文链接:https://www.cnblogs.com/shenben/p/5459943.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
本文链接:https://www.cnblogs.com/shenben/p/5459943.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术